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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 counter.element.classList.toggle("toolbar-counter-item-first", !tota
l); | 233 counter.element.classList.toggle("toolbar-counter-item-first", !tota
l); |
234 counter.span.textContent = value; | 234 counter.span.textContent = value; |
235 total += value; | 235 total += value; |
236 if (counter.title) { | 236 if (counter.title) { |
237 if (title) | 237 if (title) |
238 title += ", "; | 238 title += ", "; |
239 title += counter.title; | 239 title += counter.title; |
240 } | 240 } |
241 } | 241 } |
242 this.element.classList.toggle("hidden", !total); | 242 this.element.classList.toggle("hidden", !total); |
243 WebInspector.Tooltip.install(this.element, title, undefined, this._actio
nId); | 243 WebInspector.Tooltip.install(this.element, title, this._actionId); |
244 }, | 244 }, |
245 | 245 |
246 /** | 246 /** |
247 * @param {!Event} event | 247 * @param {!Event} event |
248 */ | 248 */ |
249 _clicked: function(event) | 249 _clicked: function(event) |
250 { | 250 { |
251 if (this._actionId) | 251 if (this._actionId) |
252 WebInspector.actionRegistry.execute(this._actionId); | 252 WebInspector.actionRegistry.execute(this._actionId); |
253 else | 253 else |
(...skipping 143 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 WebInspector.Tooltip.install(this.element, this._title, this._actionId); |
408 }, | 408 }, |
409 | 409 |
410 /** | 410 /** |
411 * @override | 411 * @override |
412 */ | 412 */ |
413 _applyEnabledState: function() | 413 _applyEnabledState: function() |
414 { | 414 { |
415 this.element.disabled = !this._enabled; | 415 this.element.disabled = !this._enabled; |
416 this._longClickController.reset(); | 416 this._longClickController.reset(); |
417 }, | 417 }, |
(...skipping 15 matching lines...) Expand all Loading... |
433 }, | 433 }, |
434 | 434 |
435 /** | 435 /** |
436 * @param {string} title | 436 * @param {string} title |
437 */ | 437 */ |
438 setTitle: function(title) | 438 setTitle: function(title) |
439 { | 439 { |
440 if (this._title === title) | 440 if (this._title === title) |
441 return; | 441 return; |
442 this._title = title; | 442 this._title = title; |
443 WebInspector.Tooltip.install(this.element, title, undefined, this._actio
nId); | 443 WebInspector.Tooltip.install(this.element, title, this._actionId); |
444 }, | 444 }, |
445 | 445 |
446 /** | 446 /** |
447 * @return {string} | 447 * @return {string} |
448 */ | 448 */ |
449 state: function() | 449 state: function() |
450 { | 450 { |
451 return this._state; | 451 return this._state; |
452 }, | 452 }, |
453 | 453 |
(...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 for (var i = 0; i < items.length; ++i) { | 1094 for (var i = 0; i < items.length; ++i) { |
1095 var item = items[i]; | 1095 var item = items[i]; |
1096 if (item) | 1096 if (item) |
1097 this.appendToolbarItem(item); | 1097 this.appendToolbarItem(item); |
1098 } | 1098 } |
1099 } | 1099 } |
1100 }, | 1100 }, |
1101 | 1101 |
1102 __proto__: WebInspector.Toolbar.prototype | 1102 __proto__: WebInspector.Toolbar.prototype |
1103 } | 1103 } |
OLD | NEW |