Skip to content

Commit 117e53c

Browse files
committed
chore: no hover boxes for phcode-no-lp-edit class and parent check too
1 parent ad13c1e commit 117e53c

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/LiveDevelopment/BrowserScripts/LiveDevProtocolRemote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@
492492
// Get the user's current selection
493493
const selection = window.getSelection();
494494
var element = event.target;
495-
if(element && element.classList && element.classList.contains("phcode-no-lp-edit")) {
495+
if(element && element.closest('.phcode-no-lp-edit')) {
496496
return;
497497
}
498498
if (element && element.hasAttribute('data-brackets-id')) {

src/LiveDevelopment/BrowserScripts/RemoteFunctions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,9 @@ function RemoteFunctions(config = {}) {
601601
if(!LivePreviewView.isElementInspectable(element) || element.nodeType !== Node.ELEMENT_NODE) {
602602
return false;
603603
}
604+
if(element && element.closest('.phcode-no-lp-edit')) {
605+
return false;
606+
}
604607

605608
// if _hoverHighlight is uninitialized, initialize it
606609
if (!_hoverHighlight && shouldShowHighlightOnHover()) {
@@ -741,7 +744,7 @@ function RemoteFunctions(config = {}) {
741744
* @param {Event} event - The click event
742745
*/
743746
function handleElementClick(element, event) {
744-
if(element && element.classList && element.classList.contains("phcode-no-lp-edit")) {
747+
if(element && element.closest('.phcode-no-lp-edit')) {
745748
return;
746749
}
747750
if (!LivePreviewView.isElementInspectable(element)) {

0 commit comments

Comments
 (0)