Skip to content

Commit

Permalink
Make shortcut key values a setting #3016
Browse files Browse the repository at this point in the history
  • Loading branch information
jlukic committed Nov 1, 2015
1 parent 767ad26 commit 4ca20c4
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions src/definitions/modules/dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 4ca20c4

Please sign in to comment.