Open core-ai-bot opened 3 years ago
Comment by redmunds Sunday Oct 28, 2012 at 23:31 GMT
Jeffrey,
Thanks for taking this one. I'm the one that filed he original bug, so obviously it bugs me :)
I think hard-coding the second param works for you because you only tested closing the file with the x icon. Try this:
Results: Remaining file should have dirty flag, but it has x icon.
It has the x icon because the third param is hard-coded to true. After fixing that, the dirty flag still is not set because the second param is hard-coded to false. Both need to be determined. Here's what I did, but give it some more testing to see if there are other cases:
var $nextListItem = $listItem.next();
if ($nextListItem && $nextListItem.length > 0) {
var canClose = ($nextListItem.find(".can-close").length === 1);
var isDirty = isOpenAndDirty($nextListItem.data(_FILE_KEY));
_updateFileStatusIcon($nextListItem, isDirty, canClose);
}
Note that $listItem.next() always returns an Object -- you need to make sure length > 0;
Also, Brackets requires tabbing of 4 spaces and passing JSLint (which you can turn on using View > JSLint).
Thanks, Randy
Comment by jeffslofish Monday Oct 29, 2012 at 00:28 GMT
Randy, thanks for the feedback. I have done a little testing with your solution, and I think there is still a bug. Here are the steps:
Results: Even though the mouse will be hovering over the second file, it will not have an X, but rather the dirty file icon, until you move the mouse.
I assume that it should also show an X in this case too, right?
Comment by redmunds Monday Oct 29, 2012 at 15:10 GMT
Good catch! Need to determine canClose for the original file (not next file) since that's where next file will be after delete:
var canClose = ($listItem.find(".can-close").length === 1);
I thought of another case to also test:
Comment by redmunds Friday Nov 02, 2012 at 02:14 GMT
Jeff,
Can you submit these changes so I can merge this into master?
Thanks, Randy
Issue by jeffslofish Saturday Oct 27, 2012 at 07:28 GMT Originally opened as https://github.com/adobe/brackets/pull/1969
Close file icon is not displayed until mouse is moved.
Fix for issue #104 on the mac.
jeffslofish included the following code: https://github.com/adobe/brackets/pull/1969/commits