Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Fix issue #2306 (Recent projects close arrow fail to close without mouse move) #2590

Merged
merged 1 commit into from
Mar 20, 2013
Merged

Conversation

jbalsas
Copy link
Contributor

@jbalsas jbalsas commented Jan 17, 2013

This is a possible fix for issue #2306. It changes click to mouseup as the event to close an entry in the list of recent projects.

It seems that jquery click event is not triggered if the mouse is already over the svg element when the old one is removed and the new one rendered, but mouseup is.

I'd say it has something to do with the lack of mouseenter, but I haven't been able to replicate it anywhere else outside this.

@ghost ghost assigned njx Jan 18, 2013
@WebsiteDeveloper
Copy link
Contributor

this change seems to fix the issue but i couldn't find out why
i tested this and found out that the checkHovers() Funtions seems to be the root of our problem, because when commenting out the call to that functions it works nicely for me

@WebsiteDeveloper
Copy link
Contributor

It seems a simple change in the checkHovers() functions also fixes the problem:
Instead of this:

$(".recent-folder-link", this).triggerHandler("mouseenter");

This works:

$(this).triggerHandler("mouseenter");

Instead of all links just trigger mouseenter on the current li

@WebsiteDeveloper
Copy link
Contributor

@jbalsas whats your opinion?

@jbalsas
Copy link
Contributor Author

jbalsas commented Feb 13, 2013

Hi @WebsiteDeveloper. I'm also still puzzled by this... my intuition is that somehow if the element doesn't detect the mouseover, jquery won't trigger the click event (it actually doesn't seem to even trigger mousedown), but I haven't been able to reproduce it anywhere else so far...

I've tried your solution and if I switch the line in checkHovers with your suggestion, then, after closing one project, the close arrow won't appear again until I move the mouse. Can you please verify if this happens to you?

@WebsiteDeveloper
Copy link
Contributor

@jbalsas in my version it works fine with my change what version of brackets are you using?
i am using the current master from the brackets repo

@jbalsas
Copy link
Contributor Author

jbalsas commented Feb 14, 2013

I've tested it on this branch merged with master, and alone just in master and in both cases the close icon won't show.

@WebsiteDeveloper Maybe I didn't get your suggestion right. As you say, $(this).triggerHandler("mouseenter"); triggers the event handlers to the li nodes. The issue is that the mouseenter callback that calls showDeleteButton is placed on the a nodes, so the button won't show unless you move the mouse after deleting one item. Am I missing something?

If we could get it to work, I'd rather have something like what you suggest, as to me, it looks closer to the original intent of the code.

@WebsiteDeveloper
Copy link
Contributor

Actually when i print out this on the console i get <li><a class="recent-folder-link">...</a></li>
which means the hover handlers get also called for the <a> nodes so for me it actually works fine
maybe you could verify that by adding a console.log(this) statement before the call to triggerHandler on line 96

@jbalsas
Copy link
Contributor Author

jbalsas commented Feb 14, 2013

Sorry, but it's still not working for me. I also can't quite see why triggering it from the <li> nodes should cause it to trigger the handlers on the <a> elements...

Could you maybe put your code together in a branch and push it to your github account so I could clone it and check it myself?

@WebsiteDeveloper
Copy link
Contributor

i'll push a branch tomorrow

@WebsiteDeveloper
Copy link
Contributor

@jbalsas
https://github.com/WebsiteDeveloper/brackets/tree/Issue-2306 here is the branch which is working for me

@jbalsas
Copy link
Contributor Author

jbalsas commented Feb 16, 2013

@WebsiteDeveloper Thanks for putting the branch together. I just cloned it, but sadly it's still not working for me.

Are you by any chance on Windows? I'm running on MacOS, so maybe this is somehow platform-specific... I don't have access to any windows machine to check it out so maybe someone else could pitch in...

@WebsiteDeveloper
Copy link
Contributor

@jbalsas it seems to be platform specific because i am running a windows 7 machine
maybe it has something to do with the brackets shell handling of certain mouse events
@njx could you please look at this

@redmunds
Copy link
Contributor

@jbalsas This looks good on Mac 10.8 and Win 7

@WebsiteDeveloper Thanks for reviewing this pull request. I also tried your solution, but it doesn't work on Mac 10.8. After removing the first item from list, the (x) icon is not displayed on the item that moves under the mouse (and click doesn't do anything), so it's actually worse.

Merging.

redmunds added a commit that referenced this pull request Mar 20, 2013
Fix issue #2306 (Recent projects close arrow fail to close without mouse move)
@redmunds redmunds merged commit 1855096 into adobe:master Mar 20, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants