diff --git a/app/assets/javascripts/bootstrap.js b/app/assets/javascripts/bootstrap.js index af3bc727..5c158c64 100644 --- a/app/assets/javascripts/bootstrap.js +++ b/app/assets/javascripts/bootstrap.js @@ -129,7 +129,6 @@ var that = this this.isShown = false - //alert(this.isShown+":"+this.$element.attr('class')) $('body').removeClass('modal-open') @@ -1250,8 +1249,8 @@ var that = this , complete = function () { if (startEvent == 'show') that.reset() - that.$element.trigger(completeEvent) - mainTablePosition(); + that.$element.trigger(completeEvent) + setTimeout(mainTablePosition,150); } this.$element diff --git a/app/assets/javascripts/sort_header.js b/app/assets/javascripts/sort_header.js deleted file mode 100644 index ef0f5a9c..00000000 --- a/app/assets/javascripts/sort_header.js +++ /dev/null @@ -1,16 +0,0 @@ -$(document).on('click', '.list-remove', function(){ - var a = []; - $('.checkbox_in_list').each(function(){ - if (this.checked) a.push("ids[]=" + this.value); - }); - var url = $(this).attr('rel'); - if (url.indexOf('?') > -1){ - $.getScript(url + '&' + a.join('&')); - }else{ - $.getScript(url + '?' + a.join('&')); - } -}); - -$(document).on('click', '#check_all', function(){ - $('.checkbox_in_list').attr("checked", this.checked); -}); \ No newline at end of file diff --git a/app/assets/javascripts/sort_header.js.erb b/app/assets/javascripts/sort_header.js.erb new file mode 100644 index 00000000..34add9fc --- /dev/null +++ b/app/assets/javascripts/sort_header.js.erb @@ -0,0 +1,19 @@ +<%#= encoding: utf-8 %> +$(document).on('click', '.list-remove', function(){ + if(confirm("<%= I18n.t('sure?') %>")){ + var a = []; + $('.checkbox_in_list').each(function(){ + if (this.checked) a.push("ids[]=" + this.value); + }); + var url = $(this).attr('rel'); + if (url.indexOf('?') > -1){ + $.getScript(url + '&' + a.join('&')); + }else{ + $.getScript(url + '?' + a.join('&')); + } + } +}); + +$(document).on('click', '#check_all', function(){ + $('.checkbox_in_list').attr("checked", this.checked); +}); \ No newline at end of file diff --git a/app/views/admin/designs/index.html.erb b/app/views/admin/designs/index.html.erb index a25b6d7f..ab672b09 100644 --- a/app/views/admin/designs/index.html.erb +++ b/app/views/admin/designs/index.html.erb @@ -8,5 +8,5 @@