diff --git a/src/chrome/content/options.js b/src/chrome/content/options.js index c16187e..eeb9ef2 100644 --- a/src/chrome/content/options.js +++ b/src/chrome/content/options.js @@ -39,9 +39,9 @@ firetray.UIOptions = { function(c) { LOG("i: "+i+", cell:"+c); c.removeEventListener( - 'DOMAttrModified', that._userChangeValueTreeServerTypes, true); + 'DOMAttrModified', that._userChangeValueTreeServerTypes, true); // FIXME c.removeEventListener( - 'DOMAttrModified', that._userChangeValueTreeAccounts, true); + 'DOMAttrModified', that._userChangeValueTreeAccounts, true); // FIXME }); } }, @@ -77,16 +77,22 @@ firetray.UIOptions = { }, _userChangeValueTreeServerTypes: function(event) { - let checkboxCell = event.originalTarget; - let tree = document.getElementById("ui_tree_mail_accounts"); + if (event.attrName === "value") { // checkbox + let checkboxCell = event.originalTarget; + let tree = document.getElementById("ui_tree_mail_accounts"); + + let rows = firetray.Utils.XPath( + checkboxCell, + 'ancestor::xul:treeitem[1]/descendant::xul:treechildren//xul:treerow'); + LOG("rows="+rows); + for (let i=0; i serverTypes[b].order) + return 1; + return 0; // no sorting + }); + LOG("serverTypesSorted: "+serverTypesSorted); + let target = document.getElementById("ui_mail_accounts"); - for (let serverTypeName in serverTypes) { - let name = serverTypes[serverTypeName]; + for (let i=0; i