From 49ba38d216ec1a1f73d0368e4942bfd6bed9e52e Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 26 Apr 2018 07:12:25 +0200 Subject: Bug 1039540 - Disable the sorting of rows of sub-dialogs when right clicking (+ style clean up) --- .../palemoon/components/preferences/permissions.js | 16 ++++++++++++++-- .../palemoon/components/preferences/permissions.xul | 4 ++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'application') 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();"> + data-field-name="rawHost" persist="width"/> + data-field-name="capability" persist="width"/> -- cgit v1.2.3