Bug Tracker

Modify

Ticket #11997 (closed feature: plugin)

Opened 11 months ago

Last modified 11 months ago

Feature enhancement: Add hasModifiers() to jQuery.Event

Reported by: michael@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocking: Blocked by:

Description

I'd propose a method for events which would be true if any of shiftKey, metaKey, etc are true.

This is an important use case for PJAX/HTML5-history apps following the practice of graceful degradation. You create a normal link and hijack it to open the page via Ajax using event.preventDefault(). However, this behaviour breaks user expectations when a modifier is in effect - users will expect the link to act as a normal link and open in a new tab/window or open the popup menu. So a convenience method would be useful in many modern web apps.

Change History

comment:1 Changed 11 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to plugin

This seems better as a plugin, or simply as app-specific code. It wouldn't get used at all within touch-based apps, for example.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.