| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 /** @type {!UI.ListControl<!UI.SuggestBox.Suggestion>} */ | 69 /** @type {!UI.ListControl<!UI.SuggestBox.Suggestion>} */ |
| 70 this._list = new UI.ListControl(this, UI.ListMode.EqualHeightItems); | 70 this._list = new UI.ListControl(this, UI.ListMode.EqualHeightItems); |
| 71 this._element = this._list.element; | 71 this._element = this._list.element; |
| 72 this._element.classList.add('suggest-box'); | 72 this._element.classList.add('suggest-box'); |
| 73 this._element.addEventListener('mousedown', event => event.preventDefault(),
true); | 73 this._element.addEventListener('mousedown', event => event.preventDefault(),
true); |
| 74 this._element.addEventListener('click', this._onClick.bind(this), false); | 74 this._element.addEventListener('click', this._onClick.bind(this), false); |
| 75 | 75 |
| 76 this._glassPane = new UI.GlassPane(); | 76 this._glassPane = new UI.GlassPane(); |
| 77 this._glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PreferBottom); | 77 this._glassPane.setAnchorBehavior(UI.GlassPane.AnchorBehavior.PreferBottom); |
| 78 this._glassPane.setSetOutsideClickCallback(this.hide.bind(this)); | 78 this._glassPane.setOutsideClickCallback(this.hide.bind(this)); |
| 79 var shadowRoot = UI.createShadowRootWithCoreStyles(this._glassPane.contentEl
ement, 'ui/suggestBox.css'); | 79 var shadowRoot = UI.createShadowRootWithCoreStyles(this._glassPane.contentEl
ement, 'ui/suggestBox.css'); |
| 80 shadowRoot.appendChild(this._element); | 80 shadowRoot.appendChild(this._element); |
| 81 } | 81 } |
| 82 | 82 |
| 83 /** | 83 /** |
| 84 * @param {boolean} value | 84 * @param {boolean} value |
| 85 */ | 85 */ |
| 86 setDefaultSelectionIsDimmed(value) { | 86 setDefaultSelectionIsDimmed(value) { |
| 87 this._defaultSelectionIsDimmed = value; | 87 this._defaultSelectionIsDimmed = value; |
| 88 this._element.classList.toggle('default-selection-is-dimmed', value); | 88 this._element.classList.toggle('default-selection-is-dimmed', value); |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 | 388 |
| 389 /** | 389 /** |
| 390 * @typedef {!{text: string, subtitle: (string|undefined), iconType: (string|und
efined), priority: (number|undefined), isSecondary: (boolean|undefined), title:
(string|undefined)}} | 390 * @typedef {!{text: string, subtitle: (string|undefined), iconType: (string|und
efined), priority: (number|undefined), isSecondary: (boolean|undefined), title:
(string|undefined)}} |
| 391 */ | 391 */ |
| 392 UI.SuggestBox.Suggestion; | 392 UI.SuggestBox.Suggestion; |
| 393 | 393 |
| 394 /** | 394 /** |
| 395 * @typedef {!Array<!UI.SuggestBox.Suggestion>} | 395 * @typedef {!Array<!UI.SuggestBox.Suggestion>} |
| 396 */ | 396 */ |
| 397 UI.SuggestBox.Suggestions; | 397 UI.SuggestBox.Suggestions; |
| OLD | NEW |