OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 else | 397 else |
398 this.dispatchEventToListeners("click", event); | 398 this.dispatchEventToListeners("click", event); |
399 }, | 399 }, |
400 | 400 |
401 /** | 401 /** |
402 * @param {string} actionId | 402 * @param {string} actionId |
403 */ | 403 */ |
404 setAction: function(actionId) | 404 setAction: function(actionId) |
405 { | 405 { |
406 this._actionId = actionId; | 406 this._actionId = actionId; |
407 WebInspector.Tooltip.install(this.element, this._title, undefined, this. _actionId); | 407 this._updateTooltip(); |
408 }, | 408 }, |
409 | 409 |
410 /** | 410 /** |
411 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys | |
412 */ | |
413 setShortcut: function(keys) | |
414 { | |
415 this._shortcutKeys = keys; | |
pfeldman
2015/08/11 05:34:56
We should have action ids for everything with the
samli
2015/08/11 07:17:01
Done.
| |
416 this._updateTooltip(); | |
417 }, | |
418 | |
419 _updateTooltip: function() | |
420 { | |
421 WebInspector.Tooltip.install(this.element, this._title, undefined, this. _actionId, this._shortcutKeys); | |
422 }, | |
423 | |
424 /** | |
411 * @override | 425 * @override |
412 */ | 426 */ |
413 _applyEnabledState: function() | 427 _applyEnabledState: function() |
414 { | 428 { |
415 this.element.disabled = !this._enabled; | 429 this.element.disabled = !this._enabled; |
416 this._longClickController.reset(); | 430 this._longClickController.reset(); |
417 }, | 431 }, |
418 | 432 |
419 /** | 433 /** |
420 * @return {boolean} | 434 * @return {boolean} |
(...skipping 12 matching lines...) Expand all Loading... | |
433 }, | 447 }, |
434 | 448 |
435 /** | 449 /** |
436 * @param {string} title | 450 * @param {string} title |
437 */ | 451 */ |
438 setTitle: function(title) | 452 setTitle: function(title) |
439 { | 453 { |
440 if (this._title === title) | 454 if (this._title === title) |
441 return; | 455 return; |
442 this._title = title; | 456 this._title = title; |
443 WebInspector.Tooltip.install(this.element, title, undefined, this._actio nId); | 457 this._updateTooltip(); |
444 }, | 458 }, |
445 | 459 |
446 /** | 460 /** |
447 * @return {string} | 461 * @return {string} |
448 */ | 462 */ |
449 state: function() | 463 state: function() |
450 { | 464 { |
451 return this._state; | 465 return this._state; |
452 }, | 466 }, |
453 | 467 |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1094 for (var i = 0; i < items.length; ++i) { | 1108 for (var i = 0; i < items.length; ++i) { |
1095 var item = items[i]; | 1109 var item = items[i]; |
1096 if (item) | 1110 if (item) |
1097 this.appendToolbarItem(item); | 1111 this.appendToolbarItem(item); |
1098 } | 1112 } |
1099 } | 1113 } |
1100 }, | 1114 }, |
1101 | 1115 |
1102 __proto__: WebInspector.Toolbar.prototype | 1116 __proto__: WebInspector.Toolbar.prototype |
1103 } | 1117 } |
OLD | NEW |