File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/LiveDevelopment/BrowserScripts Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ function RemoteFunctions(config) {
3434 // TODO: give this var a better name
3535 let isFlagActive = true ;
3636
37+ // this will store the element that was clicked previously (before the new click)
38+ // we need this so that we can remove click styling from the previous element when a new element is clicked
39+ let previouslyClickedElement = null ;
40+
3741 var experimental ;
3842 if ( ! config ) {
3943 experimental = false ;
@@ -866,7 +870,21 @@ function RemoteFunctions(config) {
866870 _nodeMoreOptionsBox . remove ( ) ;
867871 _nodeMoreOptionsBox = null ;
868872 }
873+
874+ // to remove the border styling from the previously clicked element
875+ if ( previouslyClickedElement ) {
876+ if ( previouslyClickedElement . _originalBorder !== undefined ) {
877+ previouslyClickedElement . style . border = previouslyClickedElement . _originalBorder ;
878+ delete previouslyClickedElement . _originalBorder ;
879+ } else {
880+ previouslyClickedElement . style . border = "" ;
881+ }
882+ }
883+
869884 _nodeMoreOptionsBox = new NodeMoreOptionsBox ( event . target ) ;
885+ event . target . _originalBorder = event . target . style . border ;
886+ event . target . style . border = "1px solid #4285F4" ;
887+ previouslyClickedElement = event . target ; // add the current element to the previouslyClickedElement
870888 }
871889 }
872890
You can’t perform that action at this time.
0 commit comments