mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-31 14:42:10 +00:00
Added a helper function "showConfirmWithExtraOption".
This commit is contained in:
@@ -1489,3 +1489,12 @@
|
|||||||
<a href="{{ SITE_ROOT }}accounts/logout/" class="item" id="logout">{% trans "Log out" %}</a>
|
<a href="{{ SITE_ROOT }}accounts/logout/" class="item" id="logout">{% trans "Log out" %}</a>
|
||||||
</div>
|
</div>
|
||||||
</script>
|
</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);
|
$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() {
|
closeModal: function() {
|
||||||
$.modal.close();
|
$.modal.close();
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user