OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2011 Google Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 break; | 322 break; |
323 } | 323 } |
324 event.consume(true); | 324 event.consume(true); |
325 }, | 325 }, |
326 | 326 |
327 _glassPaneMouseUp: function(event) | 327 _glassPaneMouseUp: function(event) |
328 { | 328 { |
329 // Return if this is simple 'click', since dispatched on glass pane, can
't use 'click' event. | 329 // Return if this is simple 'click', since dispatched on glass pane, can
't use 'click' event. |
330 if (new Date().getTime() - this._time < 300) | 330 if (new Date().getTime() - this._time < 300) |
331 return; | 331 return; |
| 332 if (event.target === this.element) |
| 333 return; |
332 this._discardMenu(true, event); | 334 this._discardMenu(true, event); |
333 event.consume(); | 335 event.consume(); |
334 }, | 336 }, |
335 | 337 |
336 /** | 338 /** |
337 * @param {boolean} closeParentMenus | 339 * @param {boolean} closeParentMenus |
338 * @param {!Event=} event | 340 * @param {!Event=} event |
339 */ | 341 */ |
340 _discardMenu: function(closeParentMenus, event) | 342 _discardMenu: function(closeParentMenus, event) |
341 { | 343 { |
(...skipping 28 matching lines...) Expand all Loading... |
370 | 372 |
371 _discardSubMenus: function() | 373 _discardSubMenus: function() |
372 { | 374 { |
373 if (this._subMenu) | 375 if (this._subMenu) |
374 this._subMenu._discardSubMenus(); | 376 this._subMenu._discardSubMenus(); |
375 this._contextMenuElement.remove(); | 377 this._contextMenuElement.remove(); |
376 if (this._parentMenu) | 378 if (this._parentMenu) |
377 delete this._parentMenu._subMenu; | 379 delete this._parentMenu._subMenu; |
378 } | 380 } |
379 } | 381 } |
OLD | NEW |