summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/preferences
diff options
context:
space:
mode:
Diffstat (limited to 'application/palemoon/components/preferences')
-rw-r--r--application/palemoon/components/preferences/permissions.js16
-rw-r--r--application/palemoon/components/preferences/permissions.xul4
2 files changed, 16 insertions, 4 deletions
diff --git a/application/palemoon/components/preferences/permissions.js b/application/palemoon/components/preferences/permissions.js
index 195d47a2f..0bae7fc8d 100644
--- a/application/palemoon/components/preferences/permissions.js
+++ b/application/palemoon/components/preferences/permissions.js
@@ -233,8 +233,20 @@ var gPermissionManager = {
var urlLabel = document.getElementById("urlLabel");
urlLabel.hidden = !urlFieldVisible;
- var os = Components.classes["@mozilla.org/observer-service;1"]
- .getService(Components.interfaces.nsIObserverService);
+ let treecols = document.getElementsByTagName("treecols")[0];
+ treecols.addEventListener("click", event => {
+ if (event.target.nodeName != "treecol" || event.button != 0) {
+ return;
+ }
+
+ let sortField = event.target.getAttribute("data-field-name");
+ if (!sortField) {
+ return;
+ }
+
+ gPermissionManager.onPermissionSort(sortField);
+ });
+
Services.obs.notifyObservers(null, NOTIFICATION_FLUSH_PERMISSIONS, this._type);
Services.obs.addObserver(this, "perm-changed", false);
diff --git a/application/palemoon/components/preferences/permissions.xul b/application/palemoon/components/preferences/permissions.xul
index 8f24c8946..ebd7242fb 100644
--- a/application/palemoon/components/preferences/permissions.xul
+++ b/application/palemoon/components/preferences/permissions.xul
@@ -54,10 +54,10 @@
onselect="gPermissionManager.onPermissionSelected();">
<treecols>
<treecol id="siteCol" label="&treehead.sitename.label;" flex="3"
- onclick="gPermissionManager.onPermissionSort('rawHost');" persist="width"/>
+ data-field-name="rawHost" persist="width"/>
<splitter class="tree-splitter"/>
<treecol id="statusCol" label="&treehead.status.label;" flex="1"
- onclick="gPermissionManager.onPermissionSort('capability');" persist="width"/>
+ data-field-name="capability" persist="width"/>
</treecols>
<treechildren/>
</tree>