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 16 matching lines...) Expand all Loading... |
27 * @constructor | 27 * @constructor |
28 * @param {!Array.<!InspectorFrontendHostAPI.ContextMenuDescriptor>} items | 28 * @param {!Array.<!InspectorFrontendHostAPI.ContextMenuDescriptor>} items |
29 * @param {function(string)} itemSelectedCallback | 29 * @param {function(string)} itemSelectedCallback |
30 * @param {!WebInspector.SoftContextMenu=} parentMenu | 30 * @param {!WebInspector.SoftContextMenu=} parentMenu |
31 */ | 31 */ |
32 WebInspector.SoftContextMenu = function(items, itemSelectedCallback, parentMenu) | 32 WebInspector.SoftContextMenu = function(items, itemSelectedCallback, parentMenu) |
33 { | 33 { |
34 this._items = items; | 34 this._items = items; |
35 this._itemSelectedCallback = itemSelectedCallback; | 35 this._itemSelectedCallback = itemSelectedCallback; |
36 this._parentMenu = parentMenu; | 36 this._parentMenu = parentMenu; |
37 } | 37 }; |
38 | 38 |
39 WebInspector.SoftContextMenu.prototype = { | 39 WebInspector.SoftContextMenu.prototype = { |
40 /** | 40 /** |
41 * @param {!Document} document | 41 * @param {!Document} document |
42 * @param {number} x | 42 * @param {number} x |
43 * @param {number} y | 43 * @param {number} y |
44 */ | 44 */ |
45 show: function(document, x, y) | 45 show: function(document, x, y) |
46 { | 46 { |
47 if (!this._items.length) | 47 if (!this._items.length) |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 | 390 |
391 _discardSubMenus: function() | 391 _discardSubMenus: function() |
392 { | 392 { |
393 if (this._subMenu) | 393 if (this._subMenu) |
394 this._subMenu._discardSubMenus(); | 394 this._subMenu._discardSubMenus(); |
395 if (this.element) | 395 if (this.element) |
396 this.element.remove(); | 396 this.element.remove(); |
397 if (this._parentMenu) | 397 if (this._parentMenu) |
398 delete this._parentMenu._subMenu; | 398 delete this._parentMenu._subMenu; |
399 } | 399 } |
400 } | 400 }; |
OLD | NEW |