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

Side by Side Diff: Source/devtools/front_end/FilterBar.js

Issue 182113004: DevTools: Get rid of Element.prototype.enableStyleClass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 9 months 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 this._update(); 484 this._update();
485 }, 485 },
486 486
487 _update: function() 487 _update: function()
488 { 488 {
489 if ((Object.keys(this._allowedTypes).length === 0) || this._allowedTypes [WebInspector.NamedBitSetFilterUI.ALL_TYPES]) { 489 if ((Object.keys(this._allowedTypes).length === 0) || this._allowedTypes [WebInspector.NamedBitSetFilterUI.ALL_TYPES]) {
490 this._allowedTypes = {}; 490 this._allowedTypes = {};
491 this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES] = tru e; 491 this._allowedTypes[WebInspector.NamedBitSetFilterUI.ALL_TYPES] = tru e;
492 } 492 }
493 for (var typeName in this._typeFilterElements) 493 for (var typeName in this._typeFilterElements)
494 this._typeFilterElements[typeName].enableStyleClass("selected", this ._allowedTypes[typeName]); 494 this._typeFilterElements[typeName].classList.toggle("selected", this ._allowedTypes[typeName]);
495 this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged , null); 495 this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged , null);
496 }, 496 },
497 497
498 /** 498 /**
499 * @param {string} name 499 * @param {string} name
500 * @param {string} label 500 * @param {string} label
501 */ 501 */
502 addBit: function(name, label) 502 addBit: function(name, label)
503 { 503 {
504 var typeFilterElement = this._filtersElement.createChild("li", name); 504 var typeFilterElement = this._filtersElement.createChild("li", name);
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 * @param {boolean} state 678 * @param {boolean} state
679 */ 679 */
680 setState: function(state) 680 setState: function(state)
681 { 681 {
682 this._checked = state; 682 this._checked = state;
683 this._update(); 683 this._update();
684 }, 684 },
685 685
686 _update: function() 686 _update: function()
687 { 687 {
688 this._checkElement.enableStyleClass("checkbox-filter-checkbox-checked", this._checked); 688 this._checkElement.classList.toggle("checkbox-filter-checkbox-checked", this._checked);
689 this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged , null); 689 this.dispatchEventToListeners(WebInspector.FilterUI.Events.FilterChanged , null);
690 }, 690 },
691 691
692 _settingChanged: function() 692 _settingChanged: function()
693 { 693 {
694 this._checked = this._setting.get(); 694 this._checked = this._setting.get();
695 this._update(); 695 this._update();
696 }, 696 },
697 697
698 /** 698 /**
(...skipping 16 matching lines...) Expand all
715 var label = this._filterElement.createChild("label"); 715 var label = this._filterElement.createChild("label");
716 var checkBorder = label.createChild("div", "checkbox-filter-checkbox"); 716 var checkBorder = label.createChild("div", "checkbox-filter-checkbox");
717 this._checkElement = checkBorder.createChild("div", "checkbox-filter-che ckbox-check"); 717 this._checkElement = checkBorder.createChild("div", "checkbox-filter-che ckbox-check");
718 this._filterElement.addEventListener("click", this._onClick.bind(this), false); 718 this._filterElement.addEventListener("click", this._onClick.bind(this), false);
719 var typeElement = label.createChild("span", "type"); 719 var typeElement = label.createChild("span", "type");
720 typeElement.textContent = title; 720 typeElement.textContent = title;
721 }, 721 },
722 722
723 __proto__: WebInspector.Object.prototype 723 __proto__: WebInspector.Object.prototype
724 } 724 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/Drawer.js ('k') | Source/devtools/front_end/FilteredItemSelectionDialog.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698