Browse Source

Make shortcut key values a setting #3016

pull/3277/head
Jack 9 years ago
parent
commit
474cc7351b
1 changed files with 15 additions and 17 deletions
  1. 32
      src/definitions/modules/dropdown.js

32
src/definitions/modules/dropdown.js

@ -40,6 +40,7 @@ $.fn.dropdown = function(parameters) {
className = settings.className,
message = settings.message,
fields = settings.fields,
keys = settings.keys,
metadata = settings.metadata,
namespace = settings.namespace,
regExp = settings.regExp,
@ -1021,7 +1022,6 @@ $.fn.dropdown = function(parameters) {
keydown: function(event) {
var
pressedKey = event.which,
keys = module.get.shortcutKeys(),
isShortcutKey = module.is.inObject(pressedKey, keys)
;
if(isShortcutKey) {
@ -1135,7 +1135,6 @@ $.fn.dropdown = function(parameters) {
keydown: function(event) {
var
pressedKey = event.which,
keys = module.get.shortcutKeys(),
isShortcutKey = module.is.inObject(pressedKey, keys)
;
if(isShortcutKey) {
@ -1495,21 +1494,6 @@ $.fn.dropdown = function(parameters) {
return range.text.length - rangeLength;
}
},
shortcutKeys: function() {
return {
backspace : 8,
delimiter : 188, // comma
deleteKey : 46,
enter : 13,
escape : 27,
pageUp : 33,
pageDown : 34,
leftArrow : 37,
upArrow : 38,
rightArrow : 39,
downArrow : 40
};
},
value: function() {
var
value = ($input.length > 0)
@ -3338,6 +3322,20 @@ $.fn.dropdown.settings = {
value : 'value' // actual dropdown value
},
keys : {
backspace : 8,
delimiter : 188, // comma
deleteKey : 46,
enter : 13,
escape : 27,
pageUp : 33,
pageDown : 34,
leftArrow : 37,
upArrow : 38,
rightArrow : 39,
downArrow : 40
},
selector : {
addition : '.addition',
dropdown : '.ui.dropdown',

Loading…
Cancel
Save