| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 this._proxyElement = element.ownerDocument.createElement("span"); | 127 this._proxyElement = element.ownerDocument.createElement("span"); |
| 128 this._proxyElement.style.display = this._proxyElementDisplay; | 128 this._proxyElement.style.display = this._proxyElementDisplay; |
| 129 element.parentElement.insertBefore(this.proxyElement, element); | 129 element.parentElement.insertBefore(this.proxyElement, element); |
| 130 this.proxyElement.appendChild(element); | 130 this.proxyElement.appendChild(element); |
| 131 this._element.classList.add("text-prompt"); | 131 this._element.classList.add("text-prompt"); |
| 132 this._element.addEventListener("keydown", this._boundOnKeyDown, false); | 132 this._element.addEventListener("keydown", this._boundOnKeyDown, false); |
| 133 this._element.addEventListener("input", this._boundOnInput, false); | 133 this._element.addEventListener("input", this._boundOnInput, false); |
| 134 this._element.addEventListener("mousewheel", this._boundOnMouseWheel, fa
lse); | 134 this._element.addEventListener("mousewheel", this._boundOnMouseWheel, fa
lse); |
| 135 this._element.addEventListener("selectstart", this._boundSelectStart, fa
lse); | 135 this._element.addEventListener("selectstart", this._boundSelectStart, fa
lse); |
| 136 this._element.addEventListener("blur", this._boundRemoveSuggestionAids,
false); | 136 this._element.addEventListener("blur", this._boundRemoveSuggestionAids,
false); |
| 137 this._element.ownerDocument.defaultView.addEventListener("resize", this.
_boundRemoveSuggestionAids, false); |
| 137 | 138 |
| 138 if (this._suggestBoxEnabled) | 139 if (this._suggestBoxEnabled) |
| 139 this._suggestBox = new WebInspector.SuggestBox(this); | 140 this._suggestBox = new WebInspector.SuggestBox(this); |
| 140 | 141 |
| 141 return this.proxyElement; | 142 return this.proxyElement; |
| 142 }, | 143 }, |
| 143 | 144 |
| 144 detach: function() | 145 detach: function() |
| 145 { | 146 { |
| 146 this._removeFromElement(); | 147 this._removeFromElement(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 177 this._element.scrollIntoView(); | 178 this._element.scrollIntoView(); |
| 178 }, | 179 }, |
| 179 | 180 |
| 180 _removeFromElement: function() | 181 _removeFromElement: function() |
| 181 { | 182 { |
| 182 this.clearAutoComplete(true); | 183 this.clearAutoComplete(true); |
| 183 this._element.removeEventListener("keydown", this._boundOnKeyDown, false
); | 184 this._element.removeEventListener("keydown", this._boundOnKeyDown, false
); |
| 184 this._element.removeEventListener("input", this._boundOnInput, false); | 185 this._element.removeEventListener("input", this._boundOnInput, false); |
| 185 this._element.removeEventListener("selectstart", this._boundSelectStart,
false); | 186 this._element.removeEventListener("selectstart", this._boundSelectStart,
false); |
| 186 this._element.removeEventListener("blur", this._boundRemoveSuggestionAid
s, false); | 187 this._element.removeEventListener("blur", this._boundRemoveSuggestionAid
s, false); |
| 188 this._element.ownerDocument.defaultView.removeEventListener("resize", th
is._boundRemoveSuggestionAids, false); |
| 187 if (this._isEditing) | 189 if (this._isEditing) |
| 188 this._stopEditing(); | 190 this._stopEditing(); |
| 189 if (this._suggestBox) | 191 if (this._suggestBox) |
| 190 this._suggestBox.removeFromElement(); | 192 this._suggestBox.removeFromElement(); |
| 191 }, | 193 }, |
| 192 | 194 |
| 193 /** | 195 /** |
| 194 * @param {function(!Event)=} blurListener | 196 * @param {function(!Event)=} blurListener |
| 195 */ | 197 */ |
| 196 _startEditing: function(blurListener) | 198 _startEditing: function(blurListener) |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 | 918 |
| 917 return; | 919 return; |
| 918 } | 920 } |
| 919 | 921 |
| 920 WebInspector.TextPrompt.prototype.onKeyDown.apply(this, arguments); | 922 WebInspector.TextPrompt.prototype.onKeyDown.apply(this, arguments); |
| 921 }, | 923 }, |
| 922 | 924 |
| 923 __proto__: WebInspector.TextPrompt.prototype | 925 __proto__: WebInspector.TextPrompt.prototype |
| 924 } | 926 } |
| 925 | 927 |
| OLD | NEW |