Ask for confirmation before layout reset

This commit is contained in:
Kijin Sung 2024-05-05 15:56:10 +09:00
parent 5daa6636a6
commit ac895d64cb
4 changed files with 12 additions and 1 deletions

View file

@ -10,3 +10,12 @@ function doPreviewLayoutCode()
$form.removeAttr('target');
$act.val(og_act);
}
$(function() {
$('.reset_layout').on('click', function(e) {
var msg = $(this).data('confirmationMsg');
if (!confirm(msg)) {
e.preventDefault();
}
});
});

View file

@ -99,7 +99,7 @@
<div class="x_clearfix btnArea">
<span class="x_pull-left">
<button type="submit" class="x_btn" name="mode" value="reset">{$lang->cmd_reset}</button>
<button type="submit" class="x_btn reset_layout" name="mode" value="reset" data-confirmation-msg="{$lang->layout_reset_confirmation}">{$lang->cmd_reset}</button>
</span>
<span class="x_pull-right x_btn-group">
<button type="button" class="x_btn" onclick="doPreviewLayoutCode()">{$lang->cmd_preview}</button>