Skip to content

Commit

Permalink
Fix score column width and position reset on restart
Browse files Browse the repository at this point in the history
Issue: #28
  • Loading branch information
moisseev committed Jun 7, 2023
1 parent c1c53b8 commit a9d530b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions experiments/scoreColumn.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,19 @@ var scoreColumn = class extends ExtensionCommon.ExtensionAPI {
.localizeMessage("spamnessColumnToolTip.label"));
treeCol.setAttribute("width", "60px");

const splitter = document.createXULElement("splitter");
splitter.setAttribute("id", "spamScoreColSplitter");
splitter.classList.add("tree-splitter");
splitter.setAttribute("resizeafter", "farthest");
splitter.style["-moz-box-ordinal-group"] = 42;

const threadCols = document.getElementById("threadCols");
const threadCol = document.getElementById("threadCol");
threadCols.insertBefore(treeCol, threadCol);
threadCols.insertBefore(splitter, threadCol);
threadCols.appendChild(treeCol);

// Restore persistent attributes. TB bug 1607575 and 1612055.
const attributes = Services.xulStore.getAttributeEnumerator(document.URL, columnId);
for (const attribute of attributes) {
const value = Services.xulStore.getValue(document.URL, columnId, attribute);
if (attribute === "ordinal") {
treeCol.ordinal = value;
} else {
treeCol.setAttribute(attribute, value);
}
}
})();

Services.obs.addObserver(RspamdSpamnessColumn.dbObserver, "MsgCreateDBView", false);
Expand Down

0 comments on commit a9d530b

Please sign in to comment.