File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -103,6 +103,10 @@ $.contextMenu is published under the [MIT license](http://www.opensource.org/lic
103
103
104
104
## Changelog ##
105
105
106
+ ### 1.6.2 (January 19th 2013) ###
107
+
108
+ * fixing "menu won't close" regression introduced by 1.6.1
109
+
106
110
### 1.6.1 (January 19th 2013) ###
107
111
108
112
* fixing potential html parsing problem
Original file line number Diff line number Diff line change @@ -355,6 +355,7 @@ var // currently active contextMenu trigger
355
355
356
356
setTimeout ( function ( ) {
357
357
var $window , hideshow , possibleTarget ;
358
+ var triggerAction = ( ( root . trigger == 'left' && button === 0 ) || ( root . trigger == 'right' && button === 2 ) ) ;
358
359
359
360
// find the element that would've been clicked, wasn't the layer in the way
360
361
if ( document . elementFromPoint ) {
@@ -363,7 +364,7 @@ var // currently active contextMenu trigger
363
364
root . $layer . show ( ) ;
364
365
}
365
366
366
- if ( root . reposition && ( ( root . trigger == 'left' && button == 0 ) || ( root . trigger == 'right' && button == 2 ) ) ) {
367
+ if ( root . reposition && triggerAction ) {
367
368
if ( document . elementFromPoint ) {
368
369
if ( root . $trigger . is ( target ) || root . $trigger . has ( target ) . length ) {
369
370
root . position . call ( root . $trigger , root , x , y ) ;
@@ -391,7 +392,7 @@ var // currently active contextMenu trigger
391
392
}
392
393
}
393
394
}
394
- if ( target ) {
395
+ if ( target && triggerAction ) {
395
396
$ ( target ) . contextMenu ( { x : x , y : y } ) ;
396
397
} else {
397
398
// TODO: it would be nice if we could prevent animations here
You can’t perform that action at this time.
0 commit comments