-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bypass events to jQuery UI Datepicker #25
base: master
Are you sure you want to change the base?
Changes from 3 commits
0bb61f3
5c8f4ee
29b23d5
9d22cd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
* http://www.opensource.org/licenses/mit-license.php | ||
* http://www.gnu.org/licenses/gpl.html | ||
* | ||
* $Version: 1.4.2 (2016.04.16 +r27) | ||
* $Version: 1.4.2 (2016.04.16 +r27a, patched) | ||
* Requires: jQuery 1.2.3+ | ||
*/ | ||
|
||
|
@@ -318,9 +318,16 @@ | |
}, X = function(e){ | ||
// X: The Focus Examination Function (for modal: true dialogs) | ||
|
||
var targetModal = $(e.target).data('jqm') || | ||
$(e.target).parents('.jqm-init:first').data('jqm'); | ||
var activeModal = ActiveModals[ActiveModals.length-1]; | ||
var $target = $(e.target), | ||
targetModal = $target.data('jqm') || | ||
$target.parents('.jqm-init:first').data('jqm'); | ||
var activeModal = ActiveModals[ActiveModals.length-1], | ||
activeModalOpts = $(activeModal).data('jqm'); | ||
|
||
// allow all elements with parents.blockMsgClass (used for jqui datepicker) | ||
if ($target.parents('.'+activeModalOpts.blockMsgClass).length > 0) { | ||
return true; | ||
} | ||
|
||
// allow bubbling if event target is within active modal dialog | ||
return (targetModal && targetModal.ID === activeModal._jqmID) ? | ||
|
@@ -356,6 +363,7 @@ | |
* (Function) onShow - User defined callback function fired when modal opened. | ||
* (Function) onHide - User defined callback function fired when modal closed. | ||
* (Function) onLoad - User defined callback function fired when ajax content loads. | ||
* (String) blockMsgClass- User defined exclusion parent class which are allowed to get focus even outside the active modal (like the jQueryUI datepicker) | ||
*/ | ||
params: { | ||
overlay: 50, | ||
|
@@ -370,7 +378,8 @@ | |
toTop: false, | ||
onShow: onShow, | ||
onHide: onHide, | ||
onLoad: false | ||
onLoad: false, | ||
blockMsgClass: 'blockMsg' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @dpesch I'd prefer not to have any side effects. lets default this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. great, I've used |
||
}, | ||
|
||
// focusFunc is fired: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpesch lets call this
modalAllow
instead ofblockMsgClass
-- and support (Mixed) instead of a (String) class. -- This way we can use .closest (https://api.jquery.com/closest/) which is faster and suppports a string match, an element, or collection.e.g.