OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 } | 518 } |
519 } | 519 } |
520 | 520 |
521 | 521 |
522 /** | 522 /** |
523 * @constructor | 523 * @constructor |
524 * @extends {WebInspector.Object} | 524 * @extends {WebInspector.Object} |
525 */ | 525 */ |
526 WebInspector.SwatchCheckbox = function(title, color) | 526 WebInspector.SwatchCheckbox = function(title, color) |
527 { | 527 { |
528 this.element = document.createElement("div"); | 528 this.element = createElement("div"); |
529 this._swatch = this.element.createChild("div", "swatch"); | 529 this._swatch = this.element.createChild("div", "swatch"); |
530 this.element.createChild("span", "title").textContent = title; | 530 this.element.createChild("span", "title").textContent = title; |
531 this._color = color; | 531 this._color = color; |
532 this.checked = true; | 532 this.checked = true; |
533 | 533 |
534 this.element.addEventListener("click", this._toggleCheckbox.bind(this), true
); | 534 this.element.addEventListener("click", this._toggleCheckbox.bind(this), true
); |
535 } | 535 } |
536 | 536 |
537 WebInspector.SwatchCheckbox.Events = { | 537 WebInspector.SwatchCheckbox.Events = { |
538 Changed: "Changed" | 538 Changed: "Changed" |
(...skipping 15 matching lines...) Expand all Loading... |
554 }, | 554 }, |
555 | 555 |
556 _toggleCheckbox: function(event) | 556 _toggleCheckbox: function(event) |
557 { | 557 { |
558 this.checked = !this.checked; | 558 this.checked = !this.checked; |
559 this.dispatchEventToListeners(WebInspector.SwatchCheckbox.Events.Changed
); | 559 this.dispatchEventToListeners(WebInspector.SwatchCheckbox.Events.Changed
); |
560 }, | 560 }, |
561 | 561 |
562 __proto__: WebInspector.Object.prototype | 562 __proto__: WebInspector.Object.prototype |
563 } | 563 } |
OLD | NEW |