mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-04 01:23:32 +09:00
Add confirmation dialog before deleting or trashing document in admin dashboard #2653
This commit is contained in:
parent
f69dc966c5
commit
078c07d9f5
5 changed files with 20 additions and 0 deletions
|
|
@ -75,6 +75,8 @@
|
|||
{@ $dashboard_stack->right[] = ob_get_clean()}
|
||||
|
||||
<script>
|
||||
xe.lang.confirm_delete = '{$lang->confirm_delete}';
|
||||
xe.lang.confirm_trash = '{$lang->confirm_trash}';
|
||||
xe.lang.this_week = '{$lang->this_week}';
|
||||
xe.lang.last_week = '{$lang->last_week}';
|
||||
xe.lang.next_week = '{$lang->next_week}';
|
||||
|
|
|
|||
|
|
@ -69,3 +69,7 @@
|
|||
</section>
|
||||
{@ $dashboard_stack->right[] = ob_get_clean()}
|
||||
|
||||
<script>
|
||||
xe.lang.confirm_delete = '{$lang->confirm_delete}';
|
||||
xe.lang.confirm_trash = '{$lang->confirm_trash}';
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -10,4 +10,16 @@ $(function() {
|
|||
$(this).removeClass('hover').find('>.action').hide();
|
||||
}
|
||||
});
|
||||
var forms = $('.dashboard>div>section form.action');
|
||||
forms.on('click', 'button', function(e) {
|
||||
var message;
|
||||
if ($(this).val() === 'trash' || $(this).val() === 'true') {
|
||||
message = xe.lang.confirm_trash;
|
||||
} else {
|
||||
message = xe.lang.confirm_delete;
|
||||
}
|
||||
if (!confirm(message)) {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue