mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-02 07:47:32 +00:00
Added a helper function "showConfirmWithExtraOption".
This commit is contained in:
parent
bdd1fc2054
commit
7514c587d5
@ -1489,3 +1489,12 @@
|
||||
<a href="{{ SITE_ROOT }}accounts/logout/" class="item" id="logout">{% trans "Log out" %}</a>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script type="text/template" id="confirm-dialog-with-extra-option-tmpl">
|
||||
<h3><%= title %></h3>
|
||||
<p><%= content %></p>
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" name="confirm-extra-option" id="confirm-extra-option" class="vam" />
|
||||
<span class="checkbox-option vam"><%= extraOption %></span>
|
||||
</label>
|
||||
</script>
|
||||
|
@ -289,6 +289,29 @@ define([
|
||||
$yesBtn.click(yesCallback);
|
||||
},
|
||||
|
||||
confirm_with_extra_option_template: _.template($('#confirm-dialog-with-extra-option-tmpl').html()),
|
||||
|
||||
showConfirmWithExtraOption: function(title, content, extraOption, yesCallback) {
|
||||
var $popup = $("#confirm-popup");
|
||||
var $cont = $('#confirm-con');
|
||||
var $yesBtn = $('#confirm-yes');
|
||||
|
||||
var html = this.confirm_with_extra_option_template({
|
||||
'title': title,
|
||||
'content': content,
|
||||
'extraOption': extraOption
|
||||
});
|
||||
|
||||
$cont.html(html);
|
||||
$popup.modal({appendTo: '#main'});
|
||||
$('#simplemodal-container').css({'height':'auto'});
|
||||
|
||||
$yesBtn.click(function() {
|
||||
var extraOptionChecked = $('#confirm-extra-option:checked').val() === 'on';
|
||||
yesCallback(extraOptionChecked);
|
||||
});
|
||||
},
|
||||
|
||||
closeModal: function() {
|
||||
$.modal.close();
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user