|
41 | 41 | jQuery(document).on('blur', ':input', function(e) { ActiveScaffold.last_focus = e.relatedTarget; }); |
42 | 42 | jQuery(document).click(function(event) { |
43 | 43 | if (!jQuery(event.target).closest('.action_group.dyn').length) { |
44 | | - jQuery('.action_group.dyn > ul').remove(); |
| 44 | + jQuery('.action_group.dyn > .dynamic-menu').each(function() { |
| 45 | + ActiveScaffold.remove_dynamic_action_group(this); |
| 46 | + }); |
45 | 47 | } |
46 | 48 | }); |
47 | 49 | jQuery(document).on('ajax:beforeSend', 'form.as_form', function(event) { |
|
304 | 306 | return true; |
305 | 307 | } else return false; |
306 | 308 | }); |
307 | | - jQuery(document).on('ajax:complete', '.action_group.dyn > ul a', function(event) { |
| 309 | + jQuery(document).on('ajax:complete', '.action_group.dyn > .dynamic-menu a', function(event) { |
308 | 310 | var action_link = ActiveScaffold.find_action_link(event.target), link = jQuery(event.target); |
309 | 311 | if (action_link && action_link.loading_indicator) action_link.loading_indicator.css('visibility', 'hidden'); |
310 | 312 | setTimeout(function() { |
311 | 313 | if (!link.parent().is('.action_group.dyn')) { |
312 | | - link.closest('.action_group.dyn > ul').remove(); |
| 314 | + ActiveScaffold.remove_dynamic_action_group(link.closest('.action_group.dyn > .dynamic-menu')); |
313 | 315 | } |
314 | 316 | }, 100); |
315 | 317 | }); |
|
1030 | 1032 | if (ActiveScaffold.config.dynamic_group_parent_class) { |
1031 | 1033 | container.addClass(ActiveScaffold.config.dynamic_group_parent_class); |
1032 | 1034 | } |
1033 | | - container.find('> ul.dynamic-menu').remove(); |
| 1035 | + container.find('> .dynamic-menu').remove(); |
1034 | 1036 | container.append(html); |
1035 | 1037 | }, |
1036 | 1038 |
|
| 1039 | + remove_dynamic_action_group: function(group) { |
| 1040 | + group = jQuery(group); |
| 1041 | + group.closest('.action_group.dyn').removeClass(ActiveScaffold.config.dynamic_group_parent_class); |
| 1042 | + group.remove(); |
| 1043 | + }, |
| 1044 | + |
1037 | 1045 | scroll_to: function(element, checkInViewport) { |
1038 | 1046 | if (typeof checkInViewport == 'undefined') checkInViewport = true; |
1039 | 1047 | if (typeof(element) == 'string') element = '#' + element; |
|
0 commit comments