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

Side by Side Diff: lib/main.js

Issue 29335559: Issue 3624 - Filter list height is too small by default if Vertical Layout is enabled (Closed)
Patch Set: Created Feb. 4, 2016, 12:11 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This Source Code is subject to the terms of the Mozilla Public License 2 * This Source Code is subject to the terms of the Mozilla Public License
3 * version 2.0 (the "License"). You can obtain a copy of the License at 3 * version 2.0 (the "License"). You can obtain a copy of the License at
4 * http://mozilla.org/MPL/2.0/. 4 * http://mozilla.org/MPL/2.0/.
5 */ 5 */
6 6
7 Cu.import("resource://gre/modules/Services.jsm"); 7 Cu.import("resource://gre/modules/Services.jsm");
8 8
9 let {Prefs} = require("prefs"); 9 let {Prefs} = require("prefs");
10 let {WindowObserver} = require("windowObserver"); 10 let {WindowObserver} = require("windowObserver");
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 var VerticalPreferencesLayout = 51 var VerticalPreferencesLayout =
52 { 52 {
53 __proto__: WindowFeature, 53 __proto__: WindowFeature,
54 windowUrl: "chrome://adblockplus/content/ui/filters.xul", 54 windowUrl: "chrome://adblockplus/content/ui/filters.xul",
55 55
56 _applyToWindow: function(window) 56 _applyToWindow: function(window)
57 { 57 {
58 let content = window.document.getElementById("content"); 58 let content = window.document.getElementById("content");
59 let splitter = window.document.getElementById("filtersSplitter"); 59 let splitter = window.document.getElementById("filtersSplitter");
60 if (!content || !splitter) 60 let tree = window.document.getElementById("filtersTree");
61 if (!content || !splitter || !tree)
61 return; 62 return;
62 63
63 content.setAttribute("orient", "vertical"); 64 content.setAttribute("orient", "vertical");
64 splitter.setAttribute("orient", "vertical"); 65 splitter.setAttribute("orient", "vertical");
66 tree.setAttribute("minheight", "60px");
65 }, 67 },
66 68
67 _removeFromWindow: function(window) 69 _removeFromWindow: function(window)
68 { 70 {
69 let content = window.document.getElementById("content"); 71 let content = window.document.getElementById("content");
70 let splitter = window.document.getElementById("filtersSplitter"); 72 let splitter = window.document.getElementById("filtersSplitter");
71 if (!content || !splitter) 73 let tree = window.document.getElementById("filtersTree");
74 if (!content || !splitter || !tree)
72 return; 75 return;
73 76
74 content.removeAttribute("orient"); 77 content.removeAttribute("orient");
75 splitter.setAttribute("orient", "horizontal"); 78 splitter.setAttribute("orient", "horizontal");
79 tree.removeAttribute("minheight");
76 } 80 }
77 }; 81 };
78 82
79 var StylesheetFeature = 83 var StylesheetFeature =
80 { 84 {
81 uri: null, 85 uri: null,
82 stylesheetService: Cc["@mozilla.org/content/style-sheet-service;1"].getService (Ci.nsIStyleSheetService), 86 stylesheetService: Cc["@mozilla.org/content/style-sheet-service;1"].getService (Ci.nsIStyleSheetService),
83 87
84 init: function() 88 init: function()
85 { 89 {
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 else 215 else
212 features[name].shutdown(); 216 features[name].shutdown();
213 } 217 }
214 } 218 }
215 219
216 // Initialize features and make sure to update them on changes 220 // Initialize features and make sure to update them on changes
217 for (let feature in features) 221 for (let feature in features)
218 updateFeature(feature); 222 updateFeature(feature);
219 223
220 Prefs.addListener(updateFeature); 224 Prefs.addListener(updateFeature);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld