File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
* [ CHANGE] #82 Add "jquery-ui/menu" as AMD dependency
4
4
* [ FEATURE] #85 Allow custom classes per entry
5
+ * [ BUGFIX] #88 Exception when target element is deleted in select event
5
6
6
7
# 1.8.1 / 2014-12-21
7
8
Original file line number Diff line number Diff line change @@ -275,13 +275,17 @@ $.widget("moogle.contextmenu", {
275
275
. unbind ( "mousedown" + this . eventNamespace )
276
276
. unbind ( "touchstart" + this . eventNamespace )
277
277
. unbind ( "keydown" + this . eventNamespace ) ;
278
- this . $menu
279
- . unbind ( "contextmenu" + this . eventNamespace ) ;
278
+
280
279
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 {
283
287
self . _trigger ( "close" ) ;
284
- } ) ;
288
+ }
285
289
} ,
286
290
/** Handle $().contextmenu("option", key, value) calls. */
287
291
_setOption : function ( key , value ) {
You can’t perform that action at this time.
0 commit comments