OLD | NEW |
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) |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 * @param {string} commitButtonTitle | 383 * @param {string} commitButtonTitle |
384 * @param {function()} commit | 384 * @param {function()} commit |
385 * @param {function()} cancel | 385 * @param {function()} cancel |
386 */ | 386 */ |
387 beginEdit: function(commitButtonTitle, commit, cancel) | 387 beginEdit: function(commitButtonTitle, commit, cancel) |
388 { | 388 { |
389 this._commit = commit; | 389 this._commit = commit; |
390 this._cancel = cancel; | 390 this._cancel = cancel; |
391 | 391 |
392 this._commitButton.textContent = commitButtonTitle; | 392 this._commitButton.textContent = commitButtonTitle; |
393 this._commitButton.scrollIntoView(); | 393 this.element.scrollIntoView(); |
394 if (this._controls.length) | 394 if (this._controls.length) |
395 this._controls[0].focus(); | 395 this._controls[0].focus(); |
396 this._validateControls(true); | 396 this._validateControls(true); |
397 }, | 397 }, |
398 | 398 |
399 _commitClicked: function() | 399 _commitClicked: function() |
400 { | 400 { |
401 if (this._commitButton.disabled) | 401 if (this._commitButton.disabled) |
402 return; | 402 return; |
403 | 403 |
404 var commit = this._commit; | 404 var commit = this._commit; |
405 this._commit = null; | 405 this._commit = null; |
406 this._cancel = null; | 406 this._cancel = null; |
407 commit(); | 407 commit(); |
408 }, | 408 }, |
409 | 409 |
410 _cancelClicked: function() | 410 _cancelClicked: function() |
411 { | 411 { |
412 var cancel = this._cancel; | 412 var cancel = this._cancel; |
413 this._commit = null; | 413 this._commit = null; |
414 this._cancel = null; | 414 this._cancel = null; |
415 cancel(); | 415 cancel(); |
416 } | 416 } |
417 } | 417 } |
OLD | NEW |