Last active
October 4, 2019 16:44
-
-
Save Adrian-Samuel/efdc1511f825c36903f19577b395e178 to your computer and use it in GitHub Desktop.
Lightspeed Workorder Note Hider
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure you wrap the script in a script tag | |
// Insert this after the <h1 class="receiptTypeTitle"> in the Sales template | |
document.addEventListener("DOMContentLoaded", () => { | |
const lines_with_notes = document.querySelectorAll('.line_note'); | |
lines_with_notes.forEach(line => { | |
const line_content = line.innerText; | |
if (/Work order/gi.test(line_content)) { | |
const firstLine = line_content.split(/\n/g)[0]; | |
line.innerHTML = line_content.replace(line_content, firstLine); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment