Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: chrome/content/ui/filters-filterview.js

Issue 29332935: Issue 3448 - TypeError: this.treeElement is null error when closing Filter Preferences (Closed)
Left Patch Set: Created Dec. 21, 2015, 4:18 p.m.
Right Patch Set: Removed unnecessary check as well (code unchanged beyond indentation) Created Dec. 21, 2015, 4:21 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView]), 632 QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView]),
633 633
634 setTree: function(boxObject) 634 setTree: function(boxObject)
635 { 635 {
636 if (!boxObject) 636 if (!boxObject)
637 return; 637 return;
638 638
639 this.init(); 639 this.init();
640 this.boxObject = boxObject; 640 this.boxObject = boxObject;
641 641
642 if (this.boxObject) 642 this.noGroupDummy = {index: 0, filter: {text: this.boxObject.treeBody.getAtt ribute("noGroupText"), dummy: true}};
643 { 643 this.noFiltersDummy = {index: 0, filter: {text: this.boxObject.treeBody.getA ttribute("noFiltersText"), dummy: true}};
644 this.noGroupDummy = {index: 0, filter: {text: this.boxObject.treeBody.getA ttribute("noGroupText"), dummy: true}}; 644 this.editDummy = {filter: {text: ""}};
645 this.noFiltersDummy = {index: 0, filter: {text: this.boxObject.treeBody.ge tAttribute("noFiltersText"), dummy: true}}; 645
646 this.editDummy = {filter: {text: ""}}; 646 let atomService = Cc["@mozilla.org/atom-service;1"].getService(Ci.nsIAtomSer vice);
647 647 let stringAtoms = ["col-filter", "col-enabled", "col-hitcount", "col-lasthit ", "type-invalid", "type-comment", "type-blocking", "type-whitelist", "type-elem hide", "type-elemhideexception", "type-cssproperty"];
648 let atomService = Cc["@mozilla.org/atom-service;1"].getService(Ci.nsIAtomS ervice); 648 let boolAtoms = ["selected", "dummy", "slow", "disabled"];
649 let stringAtoms = ["col-filter", "col-enabled", "col-hitcount", "col-lasth it", "type-invalid", "type-comment", "type-blocking", "type-whitelist", "type-el emhide", "type-elemhideexception", "type-cssproperty"]; 649
650 let boolAtoms = ["selected", "dummy", "slow", "disabled"]; 650 this.atoms = {};
651 651 for (let atom of stringAtoms)
652 this.atoms = {}; 652 this.atoms[atom] = atomService.getAtom(atom);
653 for (let atom of stringAtoms) 653 for (let atom of boolAtoms)
654 this.atoms[atom] = atomService.getAtom(atom); 654 {
655 for (let atom of boolAtoms) 655 this.atoms[atom + "-true"] = atomService.getAtom(atom + "-true");
656 { 656 this.atoms[atom + "-false"] = atomService.getAtom(atom + "-false");
657 this.atoms[atom + "-true"] = atomService.getAtom(atom + "-true"); 657 }
658 this.atoms[atom + "-false"] = atomService.getAtom(atom + "-false"); 658
659 } 659 let columns = this.boxObject.columns;
660 660 for (let i = 0; i < columns.length; i++)
661 let columns = this.boxObject.columns; 661 if (columns[i].element.hasAttribute("sortDirection"))
662 for (let i = 0; i < columns.length; i++) 662 this.sortBy(columns[i].id, columns[i].element.getAttribute("sortDirectio n"));
663 if (columns[i].element.hasAttribute("sortDirection")) 663
664 this.sortBy(columns[i].id, columns[i].element.getAttribute("sortDirect ion")); 664 this.refresh(true);
665
666 this.refresh(true);
667 }
668 665
669 // Stop propagation of keypress events so that these aren't intercepted by 666 // Stop propagation of keypress events so that these aren't intercepted by
670 // the findbar. 667 // the findbar.
671 this.treeElement.inputField.addEventListener("keypress", event => { 668 this.treeElement.inputField.addEventListener("keypress", event => {
672 event.stopPropagation(); 669 event.stopPropagation();
673 }, false); 670 }, false);
674 }, 671 },
675 672
676 selection: null, 673 selection: null,
677 674
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 getProgressMode: () => null, 834 getProgressMode: () => null,
838 getImageSrc: () => null, 835 getImageSrc: () => null,
839 isSeparator: () => false, 836 isSeparator: () => false,
840 performAction: () => {}, 837 performAction: () => {},
841 performActionOnRow: () => {}, 838 performActionOnRow: () => {},
842 performActionOnCell: () => {}, 839 performActionOnCell: () => {},
843 getCellValue: () => null, 840 getCellValue: () => null,
844 setCellValue: () => {}, 841 setCellValue: () => {},
845 selectionChanged: () => {} 842 selectionChanged: () => {}
846 }; 843 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld