mirror of
https://gitlab.com/Shinobi-Systems/ShinobiCE.git
synced 2025-03-09 15:40:15 +00:00
48 lines
No EOL
1.9 KiB
Text
48 lines
No EOL
1.9 KiB
Text
<!--Confirmation Window-->
|
|
<div class="modal fade" id="confirm_window" role="dialog" aria-labelledby="confirm_windowLabel" aria-hidden="true">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
<h4 class="modal-title" id="confirm_windowLabel"><i class="fa fa-exclamation-circle"></i> <span><%- lang['Confirm'] %></span></h4>
|
|
</div>
|
|
<div class="modal-body"></div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-default pull-left" data-dismiss="modal"><i class="fa fa-times"></i> <%- lang['Close'] %></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script>
|
|
//confirmwindow
|
|
$.confirm={e:$('#confirm_window')};
|
|
$.confirm.title=$.confirm.e.find('.modal-title span')
|
|
$.confirm.body=$.confirm.e.find('.modal-body')
|
|
$.confirm.footer=$.confirm.e.find('.modal-footer')
|
|
$.confirm.click=function(x,e){
|
|
$.confirm.footer.find('.confirmaction').remove()
|
|
var createButton = function(x,place,callback){
|
|
$.confirm.footer.prepend('<button type="button" class="btn '+x.class+' confirmaction confirmaction'+place+'">'+x.title+'</button>')
|
|
if(!x.class){x.class='btn-success'}
|
|
if(!x.title){x.title='Save changes'}
|
|
$.confirm.footer.find('.confirmaction'+place).click(function(){
|
|
$.confirm.e.modal('hide')
|
|
callback();
|
|
})
|
|
}
|
|
if(x instanceof Array){
|
|
$.each(x,function(place,x){
|
|
createButton(x,place,x.callback)
|
|
})
|
|
}else{
|
|
createButton(x,0,e)
|
|
}
|
|
}
|
|
$(document).ready(function(){
|
|
$.confirm.e.on('hidden.bs.modal', function () {
|
|
$.confirm.footer.find('.confirmaction').remove()
|
|
})
|
|
})
|
|
</script> |