Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/ui/ListWidget.js

Issue 2440953003: DevTools: use semicolons after each statement. (Closed)
Patch Set: rebaseline Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @extends {WebInspector.VBox} 7 * @extends {WebInspector.VBox}
8 * @param {!WebInspector.ListWidget.Delegate} delegate 8 * @param {!WebInspector.ListWidget.Delegate} delegate
9 */ 9 */
10 WebInspector.ListWidget = function(delegate) 10 WebInspector.ListWidget = function(delegate)
11 { 11 {
12 WebInspector.VBox.call(this, true); 12 WebInspector.VBox.call(this, true);
13 this.registerRequiredCSS("ui/listWidget.css"); 13 this.registerRequiredCSS("ui/listWidget.css");
14 this._delegate = delegate; 14 this._delegate = delegate;
15 15
16 this._list = this.contentElement.createChild("div", "list"); 16 this._list = this.contentElement.createChild("div", "list");
17 17
18 /** @type {?WebInspector.ListWidget.Editor} */ 18 /** @type {?WebInspector.ListWidget.Editor} */
19 this._editor = null; 19 this._editor = null;
20 /** @type {*|null} */ 20 /** @type {*|null} */
21 this._editItem = null; 21 this._editItem = null;
22 /** @type {?Element} */ 22 /** @type {?Element} */
23 this._editElement = null; 23 this._editElement = null;
24 24
25 /** @type {?Element} */ 25 /** @type {?Element} */
26 this._emptyPlaceholder = null; 26 this._emptyPlaceholder = null;
27 27
28 this.clear(); 28 this.clear();
29 } 29 };
30 30
31 /** 31 /**
32 * @interface 32 * @interface
33 */ 33 */
34 WebInspector.ListWidget.Delegate = function() 34 WebInspector.ListWidget.Delegate = function()
35 { 35 {
36 } 36 };
37 37
38 WebInspector.ListWidget.Delegate.prototype = { 38 WebInspector.ListWidget.Delegate.prototype = {
39 /** 39 /**
40 * @param {*} item 40 * @param {*} item
41 * @param {boolean} editable 41 * @param {boolean} editable
42 * @return {!Element} 42 * @return {!Element}
43 */ 43 */
44 renderItem: function(item, editable) { }, 44 renderItem: function(item, editable) { },
45 45
46 /** 46 /**
47 * @param {*} item 47 * @param {*} item
48 * @param {number} index 48 * @param {number} index
49 */ 49 */
50 removeItemRequested: function(item, index) { }, 50 removeItemRequested: function(item, index) { },
51 51
52 /** 52 /**
53 * @param {*} item 53 * @param {*} item
54 * @return {!WebInspector.ListWidget.Editor} 54 * @return {!WebInspector.ListWidget.Editor}
55 */ 55 */
56 beginEdit: function(item) { }, 56 beginEdit: function(item) { },
57 57
58 /** 58 /**
59 * @param {*} item 59 * @param {*} item
60 * @param {!WebInspector.ListWidget.Editor} editor 60 * @param {!WebInspector.ListWidget.Editor} editor
61 * @param {boolean} isNew 61 * @param {boolean} isNew
62 */ 62 */
63 commitEdit: function(item, editor, isNew) { } 63 commitEdit: function(item, editor, isNew) { }
64 } 64 };
65 65
66 WebInspector.ListWidget.prototype = { 66 WebInspector.ListWidget.prototype = {
67 clear: function() 67 clear: function()
68 { 68 {
69 this._items = []; 69 this._items = [];
70 this._editable = []; 70 this._editable = [];
71 this._elements = []; 71 this._elements = [];
72 this._lastSeparator = false; 72 this._lastSeparator = false;
73 this._list.removeChildren(); 73 this._list.removeChildren();
74 this._updatePlaceholder(); 74 this._updatePlaceholder();
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 if (this._editor && this._editor.element.parentElement) 253 if (this._editor && this._editor.element.parentElement)
254 this._editor.element.remove(); 254 this._editor.element.remove();
255 255
256 this._editor = null; 256 this._editor = null;
257 this._editItem = null; 257 this._editItem = null;
258 this._editElement = null; 258 this._editElement = null;
259 this._updatePlaceholder(); 259 this._updatePlaceholder();
260 }, 260 },
261 261
262 __proto__: WebInspector.VBox.prototype 262 __proto__: WebInspector.VBox.prototype
263 } 263 };
264 264
265 /** 265 /**
266 * @constructor 266 * @constructor
267 */ 267 */
268 WebInspector.ListWidget.Editor = function() 268 WebInspector.ListWidget.Editor = function()
269 { 269 {
270 this.element = createElementWithClass("div", "editor-container"); 270 this.element = createElementWithClass("div", "editor-container");
271 this.element.addEventListener("keydown", onKeyDown.bind(null, isEscKey, this ._cancelClicked.bind(this)), false); 271 this.element.addEventListener("keydown", onKeyDown.bind(null, isEscKey, this ._cancelClicked.bind(this)), false);
272 this.element.addEventListener("keydown", onKeyDown.bind(null, isEnterKey, th is._commitClicked.bind(this)), false); 272 this.element.addEventListener("keydown", onKeyDown.bind(null, isEnterKey, th is._commitClicked.bind(this)), false);
273 273
(...skipping 27 matching lines...) Expand all
301 this._validators = []; 301 this._validators = [];
302 302
303 /** @type {?function()} */ 303 /** @type {?function()} */
304 this._commit = null; 304 this._commit = null;
305 /** @type {?function()} */ 305 /** @type {?function()} */
306 this._cancel = null; 306 this._cancel = null;
307 /** @type {*|null} */ 307 /** @type {*|null} */
308 this._item = null; 308 this._item = null;
309 /** @type {number} */ 309 /** @type {number} */
310 this._index = -1; 310 this._index = -1;
311 } 311 };
312 312
313 WebInspector.ListWidget.Editor.prototype = { 313 WebInspector.ListWidget.Editor.prototype = {
314 /** 314 /**
315 * @return {!Element} 315 * @return {!Element}
316 */ 316 */
317 contentElement: function() 317 contentElement: function()
318 { 318 {
319 return this._contentElement; 319 return this._contentElement;
320 }, 320 },
321 321
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 421
422 _cancelClicked: function() 422 _cancelClicked: function()
423 { 423 {
424 var cancel = this._cancel; 424 var cancel = this._cancel;
425 this._commit = null; 425 this._commit = null;
426 this._cancel = null; 426 this._cancel = null;
427 this._item = null; 427 this._item = null;
428 this._index = -1; 428 this._index = -1;
429 cancel(); 429 cancel();
430 } 430 }
431 } 431 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698