fix some slow javascript. oops
This commit is contained in:
parent
996ccd55f0
commit
7b8cd65a55
@ -11,7 +11,7 @@
|
||||
return $(this).parent().siblings(selector);
|
||||
}
|
||||
|
||||
$('.add_fields').live('click', function(e) {
|
||||
$(document).on('click', '.add_fields', function(e) {
|
||||
e.preventDefault();
|
||||
var $this = $(this),
|
||||
assoc = $this.data('association'),
|
||||
@ -67,7 +67,6 @@
|
||||
|
||||
trigger_node.trigger('cocoon:before-remove', [node_to_delete]);
|
||||
|
||||
|
||||
var timeout = trigger_node.data('remove-timeout') || 0;
|
||||
|
||||
setTimeout(
|
||||
|
@ -1,8 +1,7 @@
|
||||
//= require jquery.ui.all
|
||||
//
|
||||
(function($) {
|
||||
$.cocoon = {
|
||||
ordered: {
|
||||
isSetUp: false,
|
||||
options: {
|
||||
items: '> .nested-fields',
|
||||
stop: function(e, ui) {
|
||||
@ -74,7 +73,10 @@
|
||||
});
|
||||
});
|
||||
|
||||
if (!$.cocoon.ordered.isSetUp) {
|
||||
$(document).on('cocoon:after-insert', function() { $.cocoon.ordered.setup(); });
|
||||
$.cocoon.ordered.isSetUp = true;
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user