Permalink
Browse files

Fixed bug when div.ui-effects-wrapper is left in DOM after on-demand …

…context menu is closed.
  • Loading branch information...
1 parent 5c95d27 commit e62cdfe7bf5c37c37bbbd28a9e236509110fef38 @toXXIc toXXIc committed Jul 16, 2012
Showing with 21 additions and 21 deletions.
  1. +21 −21 src/jquery.contextMenu.js
View
@@ -890,28 +890,28 @@ var // currently active contextMenu trigger
//$(document).off('.contextMenuAutoHide keydown.contextMenu'); // http://bugs.jquery.com/ticket/10705
$(document).off('.contextMenuAutoHide').off('keydown.contextMenu');
// hide menu
- opt.$menu && opt.$menu[opt.animation.hide](opt.animation.duration);
-
- // tear down dynamically built menu
- if (opt.build) {
- opt.$menu.remove();
- $.each(opt, function(key, value) {
- switch (key) {
- case 'ns':
- case 'selector':
- case 'build':
- case 'trigger':
- return true;
+ opt.$menu && opt.$menu[opt.animation.hide](opt.animation.duration, function (){
+ // tear down dynamically built menu after animation is completed.
+ if (opt.build) {
+ opt.$menu.remove();
+ $.each(opt, function(key, value) {
+ switch (key) {
+ case 'ns':
+ case 'selector':
+ case 'build':
+ case 'trigger':
+ return true;
- default:
- opt[key] = undefined;
- try {
- delete opt[key];
- } catch (e) {}
- return true;
- }
- });
- }
+ default:
+ opt[key] = undefined;
+ try {
+ delete opt[key];
+ } catch (e) {}
+ return true;
+ }
+ });
+ }
+ });
},
create: function(opt, root) {
if (root === undefined) {

0 comments on commit e62cdfe

Please sign in to comment.