Add default delete modal usage:
- <%= render 'layouts/delete_modal', delete_options: {title: '', warning: '', cancel: '', submit: '' } %>
- in default index, just set title, warning, cancel and submit in quick_edit if needed
This commit is contained in:
1 parent
b3cdffb59e
commit
d434b878a7
8 files changed
+33
-32
No files matched your search
@@ -466,6 +466,15 @@ if($.support.touch) {
|
||||
}(window.jQuery);
|
||||
|
||||
|
||||
var ini = function() {
|
||||
api = this
|
||||
api.modal = function(e) {
|
||||
$('#dialog a.delete-item').attr("href", e);
|
||||
$('#dialog').modal('show');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Open Slide
|
||||
function openSlide() {
|
||||
var $openSlide = $('.open-slide'),
|
||||
@@ -521,6 +530,10 @@ function changeStatusHidden() {
|
||||
|
||||
// Document Ready
|
||||
$(function() {
|
||||
new ini();
|
||||
$('.delete').on('click', function() {
|
||||
api.modal($(this).attr('rel'));
|
||||
})
|
||||
initialState();
|
||||
$('#login').on('shown', function () {
|
||||
$(document.body).addClass('modalBlur');
|
||||
|
||||
Reference in new issue
Block a user