File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed
Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 22
33* [ CHANGE] #82 Add "jquery-ui/menu" as AMD dependency
44* [ FEATURE] #85 Allow custom classes per entry
5+ * [ BUGFIX] #88 Exception when target element is deleted in select event
56
67# 1.8.1 / 2014-12-21
78
Original file line number Diff line number Diff line change @@ -275,13 +275,17 @@ $.widget("moogle.contextmenu", {
275275 . unbind ( "mousedown" + this . eventNamespace )
276276 . unbind ( "touchstart" + this . eventNamespace )
277277 . unbind ( "keydown" + this . eventNamespace ) ;
278- this . $menu
279- . unbind ( "contextmenu" + this . eventNamespace ) ;
278+
280279 self . currentTarget = null ; // issue #44 after hide animation is too late
281-
282- this . _hide ( this . $menu , hideOpts , function ( ) {
280+ if ( this . $menu ) { // #88: widget might have been destroyed already
281+ this . $menu
282+ . unbind ( "contextmenu" + this . eventNamespace ) ;
283+ this . _hide ( this . $menu , hideOpts , function ( ) {
284+ self . _trigger ( "close" ) ;
285+ } ) ;
286+ } else {
283287 self . _trigger ( "close" ) ;
284- } ) ;
288+ }
285289 } ,
286290 /** Handle $().contextmenu("option", key, value) calls. */
287291 _setOption : function ( key , value ) {
You can’t perform that action at this time.
0 commit comments