Skip to content

Commit 2b8dfa6

Browse files
Palingenesisqu1ck
authored andcommitted
Added a setting Check box to "highlight row on click"
instead of mouse over
1 parent 92b7a54 commit 2b8dfa6

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

InteractiveHtmlBom/web/ibom.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@
124124
<input id="dnpOutlineCheckbox" type="checkbox" checked onchange="dnpOutline(this.checked)">
125125
DNP outlined
126126
</label>
127+
<label class="menu-label">
128+
<input id="highlightRowOnClickCheckbox" type="checkbox" checked onchange="setHighlightRowOnClick(this.checked)">
129+
Highlight row on click
130+
</label>
127131
<label class="menu-label">
128132
<input id="dragCheckbox" type="checkbox" checked onchange="setRedrawOnDrag(this.checked)">
129133
Continuous redraw on drag

InteractiveHtmlBom/web/ibom.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,14 @@ function setHighlightPin1(value) {
133133
redrawIfInitDone();
134134
}
135135

136+
function setHighlightRowOnClick(value) {
137+
settings.highlightRowOnClick = value;
138+
writeStorage("highlightRowOnClick", value);
139+
if (initDone) {
140+
populateBomTable();
141+
}
142+
}
143+
136144
function getStoredCheckboxRefs(checkbox) {
137145
function convert(ref) {
138146
var intref = parseInt(ref);
@@ -737,7 +745,12 @@ function populateBomBody(placeholderColumn = null, placeHolderElements = null) {
737745
}
738746
bom.appendChild(tr);
739747
var handler = createRowHighlightHandler(tr.id, references, netname);
740-
tr.onmousemove = handler;
748+
//tr.onmousemove = handler; /* Made a choice in settings */
749+
if (settings.highlightRowOnClick) {
750+
tr.onmousedown = handler;
751+
} else {
752+
tr.onmousemove = handler;
753+
}
741754
highlightHandlers.push({
742755
id: tr.id,
743756
handler: handler,

InteractiveHtmlBom/web/util.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ function overwriteSettings(newSettings) {
449449
document.getElementById("dnpOutlineCheckbox").checked = settings.renderDnpOutline;
450450
setRedrawOnDrag(settings.redrawOnDrag);
451451
document.getElementById("dragCheckbox").checked = settings.redrawOnDrag;
452+
setHighlightRowOnClick(settings.highlightRowOnClick);
453+
document.getElementById("highlightRowOnClickCheckbox").checked = settings.highlightRowOnClick;
452454
setDarkMode(settings.darkMode);
453455
document.getElementById("darkmodeCheckbox").checked = settings.darkMode;
454456
setHighlightPin1(settings.highlightpin1);
@@ -573,6 +575,7 @@ function initDefaults() {
573575
}
574576
initBooleanSetting("dnpOutline", false, "dnpOutlineCheckbox", dnpOutline);
575577
initBooleanSetting("redrawOnDrag", config.redraw_on_drag, "dragCheckbox", setRedrawOnDrag);
578+
initBooleanSetting("highlightRowOnClick", false, "highlightRowOnClickCheckbox", setHighlightRowOnClick);
576579
initBooleanSetting("darkmode", config.dark_mode, "darkmodeCheckbox", setDarkMode);
577580

578581
var fields = ["checkboxes", "References"].concat(config.fields).concat(["Quantity"]);

0 commit comments

Comments
 (0)