File tree Expand file tree Collapse file tree 1 file changed +21
-21
lines changed Expand file tree Collapse file tree 1 file changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -890,28 +890,28 @@ var // currently active contextMenu trigger
890890 //$(document).off('.contextMenuAutoHide keydown.contextMenu'); // http://bugs.jquery.com/ticket/10705
891891 $ ( document ) . off ( '.contextMenuAutoHide' ) . off ( 'keydown.contextMenu' ) ;
892892 // hide menu
893- opt . $menu && opt . $menu [ opt . animation . hide ] ( opt . animation . duration ) ;
894-
895- // tear down dynamically built menu
896- if ( opt . build ) {
897- opt . $menu . remove ( ) ;
898- $ . each ( opt , function ( key , value ) {
899- switch ( key ) {
900- case 'ns' :
901- case 'selector' :
902- case 'build' :
903- case 'trigger' :
904- return true ;
893+ opt . $menu && opt . $menu [ opt . animation . hide ] ( opt . animation . duration , function ( ) {
894+ // tear down dynamically built menu after animation is completed.
895+ if ( opt . build ) {
896+ opt . $menu . remove ( ) ;
897+ $ . each ( opt , function ( key , value ) {
898+ switch ( key ) {
899+ case 'ns' :
900+ case 'selector' :
901+ case 'build' :
902+ case 'trigger' :
903+ return true ;
905904
906- default :
907- opt [ key ] = undefined ;
908- try {
909- delete opt [ key ] ;
910- } catch ( e ) { }
911- return true ;
912- }
913- } ) ;
914- }
905+ default :
906+ opt [ key ] = undefined ;
907+ try {
908+ delete opt [ key ] ;
909+ } catch ( e ) { }
910+ return true ;
911+ }
912+ } ) ;
913+ }
914+ } ) ;
915915 } ,
916916 create : function ( opt , root ) {
917917 if ( root === undefined ) {
You can’t perform that action at this time.
0 commit comments