Quantcast
Channel: Grassroots Oracle
Viewing all articles
Browse latest Browse all 405

Apex - closing modal page on escape

$
0
0
I've been making use of the Skillbuilders Modal Page plug-in a fair bit recently, and I thought I'd share this little ditty on closing the dialog when the escape button is pressed.

I set the event to Key Release, using the 'document' DOM object.

The JavaScript condition is set to 'event.which = 27' - the ASCII translation of the escape key.

Finally, the true action closes the window, passing nothing back to the calling page
javascript:window.parent.$(window.parent.document).apex_modal_page('close','');>

Inline images 1

Of course, aside from the action - the same event can be captured if you're listening for the escape key for whatever reason.

Hope it helps.

Viewing all articles
Browse latest Browse all 405

Latest Images

Trending Articles



Latest Images