Hitting the Escape key should close the teleport dialog box (window).

Comments

xano’s picture

Hmm, I'm thinking if it would be wise to use ESC as a hotkey. It's not unlikely some software on the user's computer has already used ESC for some feature. I think normal hotkeys like what's being used at this moment would be best. Not best for the module itself in means that using the module won't become easier, but best in means that it won't conflict with other software and that it's consistent.

Remember, it's not Quicksilver, just an imitation, a web 'application'.

incidentist’s picture

Assigned: Unassigned » incidentist

Oh, I think it's a good idea. There've been a bunch of times when I've reflexively hit Esc and expected Teleport to close. Also, the standard autocomplete form already intercepts Esc to hide the list of autocompleted items. I've just got to change that interception to close the whole dialog if the list is already hidden.

moshe weitzman’s picture

FYI, I expected this too.

jjeff’s picture

Okay, here's a patch that does the following things:

1) Makes the ESC key close the modal box.
2) Makes any click anywhere outside of the modal box close Teleport
3) Changes the show/hide actions to fadeIn/fadeOut so that the whole box fades in/out rather than animating size

Other things to be aware of with this patch.
* It adds an id of "teleport-button" to the teleport button. This is needed in order to exclude it from the document.click action.
* The patch removes a few lines of what looked like leftover variable definitions.

jjeff’s picture

Status: Active » Needs review
StatusFileSize
new2.98 KB

d'oh... here's the patch...

jjeff’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev

patch is actually against 5.x... dunno if .js files are the same between versions...

jjeff’s picture

StatusFileSize
new2.74 KB
new3.56 KB

Okay, I'll admit this is getting ridiculous now.

Here's a patch that (in addition to the above features) adds IE compatibility by changing the method from the 'accesskey' trick to a $(document).keydown() listener.

Tested and working in Safari (Mac), Firefox (Mac), and Internet Explorer (Win). NOT working in Opera on the Mac, but also not breaking anything.

Technically this is a fix to another issue, but since it builds on the code for this issue/patch, I thought it made more sense to post here.

At this point, the patch is larger than the entire teleport.js file, so I've also included the entire file here too.

incidentist’s picture

Ridiculous? Ridiculously awesome, more like. I'll take a look and try to commit it within the next couple of days. I looked briefly at the IE accesskey issue, and it looks like there may be a non-hack solution but it is (blissfully) difficult for me to get access to an IE6 box for testing.

psynaptic’s picture

I'll can test IE (as well as other browsers on Win) and also any browsers on Mac too. Just let me know and I'm there.

jjeff’s picture

Psynaptic, yes, please test! Any and all testing is always helpful.

Thanks.

psynaptic’s picture

Hey Jeff, I've just check my track and found this.

I'm working on a client site right now but will do some testing on this ASAP. Is there anything you feel needs particular attention?

psynaptic’s picture

I've been testing and it seems to work well so far. The only problem I have is that I like to use ` backtick/tilde key to invoke. I'll try and see if I can fix it.

incidentist’s picture

Status: Needs review » Fixed

Applied the patch, tested on FF/Mac and IE6. Works well so I committed it.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.