Orange rectangle around button and menu list does not disappear

Anyone, especially newbies, asking for help with Photoshop Scripting and Photoshop Automation - as opposed to those contributing to discussion about an aspect of Photoshop Scripting

Moderators: xbytor, DavideBarranca, Paul MR

teslaball
Posts: 3
Joined: Wed Jan 25, 2017 2:32 pm

Orange rectangle around button and menu list does not disappear

Postby teslaball » Wed Jan 25, 2017 2:45 pm

Hello people,

I am new to this forum and need help on Photoshop CC2017 HTML5 extension that I am building.

The dropdown menu is working as expected, but actually there are two problems left, the first problem is when clicking on the dropdown button it is framed in an orange rectangle which I want to get rid of it and the second problem is when a menu list is opened, it disappears only when clicked in the area of the extension, but when clicking outside in an area somewhere else in Photoshop, it stays open which I want it to disappear.

Can someone do the trick for these two problems being solved please?

Here's the code example in Javascript:

Code: Select all

    //dropdown 
    function dropdown_one(btn) { 
      document.getElementById("menu_list").classList.toggle("dcontent"); 
      btn.classList.toggle("button-selected"); 
    } 
    //condition 
    window.onclick = function(event) { 
      if (!event.target.matches('.button')) { 
     
       var menu = document.getElementsByClassName("dropdown-content"); 
       var i; 
       for (i = 0; i < menu.length; i++) { 
       var open_list = menu[i]; 
       if (open_list.classList.contains('dcontent')) { 
      open_list.classList.remove('dcontent'); 
       } 
       } 
       var selected = document.getElementsByClassName("button-selected"); 
       for (var i = 0, len = selected.length; i < len; i++) { 
      selected[i].classList.remove("button-selected"); 
       } 
      } 
    } 


Thanks,
teslaball



teslaball
Posts: 3
Joined: Wed Jan 25, 2017 2:32 pm

Re: Orange rectangle around button and menu list does not disappear

Postby teslaball » Thu Jan 26, 2017 9:42 am

Is there anyone who could help me in solving this problem? I think solving this problem isn't hard at all for the experienced.

User avatar
txuku
Posts: 30
Joined: Thu Jan 01, 1970 12:00 am
Contact:

Re: Orange rectangle around button and menu list does not disappear

Postby txuku » Wed Feb 01, 2017 8:14 am

Bonjour

It seems to me that you do not provide all the elements necessary to the execution of this script ???

For me ; Error2
Windows is not defined line 7

teslaball
Posts: 3
Joined: Wed Jan 25, 2017 2:32 pm

Re: Orange rectangle around button and menu list does not disappear

Postby teslaball » Fri Feb 03, 2017 2:06 pm

txuku wrote:Bonjour

It seems to me that you do not provide all the elements necessary to the execution of this script ???

For me ; Error2
Windows is not defined line 7

Do you need the HTML+CSS code?
The code works perfectly inside PS, only the annoying orange rectangle and clicking outside the extension the dropdown won't disappear.


Return to “Help Me”

Who is online

Users browsing this forum: No registered users and 2 guests