Skip to content

Commit

Permalink
Added a setting Check box to "highlight row on click"
Browse files Browse the repository at this point in the history
instead of mouse over
  • Loading branch information
Palingenesis authored and qu1ck committed Aug 14, 2024
1 parent 92b7a54 commit 2b8dfa6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
4 changes: 4 additions & 0 deletions InteractiveHtmlBom/web/ibom.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
<input id="dnpOutlineCheckbox" type="checkbox" checked onchange="dnpOutline(this.checked)">
DNP outlined
</label>
<label class="menu-label">
<input id="highlightRowOnClickCheckbox" type="checkbox" checked onchange="setHighlightRowOnClick(this.checked)">
Highlight row on click
</label>
<label class="menu-label">
<input id="dragCheckbox" type="checkbox" checked onchange="setRedrawOnDrag(this.checked)">
Continuous redraw on drag
Expand Down
15 changes: 14 additions & 1 deletion InteractiveHtmlBom/web/ibom.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,14 @@ function setHighlightPin1(value) {
redrawIfInitDone();
}

function setHighlightRowOnClick(value) {
settings.highlightRowOnClick = value;
writeStorage("highlightRowOnClick", value);
if (initDone) {
populateBomTable();
}
}

function getStoredCheckboxRefs(checkbox) {
function convert(ref) {
var intref = parseInt(ref);
Expand Down Expand Up @@ -737,7 +745,12 @@ function populateBomBody(placeholderColumn = null, placeHolderElements = null) {
}
bom.appendChild(tr);
var handler = createRowHighlightHandler(tr.id, references, netname);
tr.onmousemove = handler;
//tr.onmousemove = handler; /* Made a choice in settings */
if (settings.highlightRowOnClick) {
tr.onmousedown = handler;
} else {
tr.onmousemove = handler;
}
highlightHandlers.push({
id: tr.id,
handler: handler,
Expand Down
3 changes: 3 additions & 0 deletions InteractiveHtmlBom/web/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ function overwriteSettings(newSettings) {
document.getElementById("dnpOutlineCheckbox").checked = settings.renderDnpOutline;
setRedrawOnDrag(settings.redrawOnDrag);
document.getElementById("dragCheckbox").checked = settings.redrawOnDrag;
setHighlightRowOnClick(settings.highlightRowOnClick);
document.getElementById("highlightRowOnClickCheckbox").checked = settings.highlightRowOnClick;
setDarkMode(settings.darkMode);
document.getElementById("darkmodeCheckbox").checked = settings.darkMode;
setHighlightPin1(settings.highlightpin1);
Expand Down Expand Up @@ -573,6 +575,7 @@ function initDefaults() {
}
initBooleanSetting("dnpOutline", false, "dnpOutlineCheckbox", dnpOutline);
initBooleanSetting("redrawOnDrag", config.redraw_on_drag, "dragCheckbox", setRedrawOnDrag);
initBooleanSetting("highlightRowOnClick", false, "highlightRowOnClickCheckbox", setHighlightRowOnClick);
initBooleanSetting("darkmode", config.dark_mode, "darkmodeCheckbox", setDarkMode);

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

0 comments on commit 2b8dfa6

Please sign in to comment.