Browse Source

Modal- add setting for keyboard shortcuts

pull/4381/head
Jack Lukic 8 years ago
parent
commit
bd924919d2
2 changed files with 9 additions and 2 deletions
  1. 1
      RELEASE-NOTES.md
  2. 10
      src/definitions/modules/modal.js

1
RELEASE-NOTES.md

@ -5,6 +5,7 @@
**Enhancements** **Enhancements**
- **Form Validation** - Bracketed notation can now be omitted for rules, instead passing in bracketed values with the `value` parameter #3313 - **Form Validation** - Bracketed notation can now be omitted for rules, instead passing in bracketed values with the `value` parameter #3313
- **Dropdown** - Using `search selection` with `selectOnKeydown` will now highlight the partial search matching the currently keyboard selected value - **Dropdown** - Using `search selection` with `selectOnKeydown` will now highlight the partial search matching the currently keyboard selected value
- **Modal** - Modal now includes setting to enable/disable keyboard shortcuts
**Bugs** **Bugs**
- **NPM** - Fixed `package.json` to allow either jQuery `2.x` or `3.x` #4254 - **NPM** - Fixed `package.json` to allow either jQuery `2.x` or `3.x` #4254

10
src/definitions/modules/modal.js

@ -345,7 +345,9 @@ $.fn.modal = function(parameters) {
useFailSafe : true, useFailSafe : true,
onComplete : function() { onComplete : function() {
settings.onVisible.apply(element); settings.onVisible.apply(element);
module.add.keyboardShortcuts();
if(settings.keyboardShortcuts) {
module.add.keyboardShortcuts();
}
module.save.focus(); module.save.focus();
module.set.active(); module.set.active();
if(settings.autofocus) { if(settings.autofocus) {
@ -391,7 +393,9 @@ $.fn.modal = function(parameters) {
if(!module.others.active() && !keepDimmed) { if(!module.others.active() && !keepDimmed) {
module.hideDimmer(); module.hideDimmer();
} }
module.remove.keyboardShortcuts();
if(settings.keyboardShortcuts) {
module.remove.keyboardShortcuts();
}
}, },
onComplete : function() { onComplete : function() {
settings.onHidden.call(element); settings.onHidden.call(element);
@ -854,6 +858,8 @@ $.fn.modal.settings = {
useCSS : true useCSS : true
}, },
// whether to use keyboard shortcuts
keyboardShortcuts: true,
context : 'body', context : 'body',

Loading…
Cancel
Save