summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorlouis cuny <louiscuny@gmail.com>2013-09-08 01:54:14 -0700
committerlouis cuny <louiscuny@gmail.com>2013-09-08 01:54:14 -0700
commita8357732cb972b541c79c73cb09b21279bf8dca5 (patch)
tree849cfd73b9b3ab7cbf844948bedc2fd82ee12171 /js
parent908cf57ec518f48e7f7b08afc1a02398dfdd1182 (diff)
parent7149be47a46f2f4e558e6afed4ab794a709cd0b0 (diff)
downloadmulti-select-a8357732cb972b541c79c73cb09b21279bf8dca5.zip
multi-select-a8357732cb972b541c79c73cb09b21279bf8dca5.tar.gz
multi-select-a8357732cb972b541c79c73cb09b21279bf8dca5.tar.bz2
Merge pull request #94 from Frique/shift-tab
Tab and Shift-Tab key behavior improvement
Diffstat (limited to 'js')
-rw-r--r--js/jquery.multi-select.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index df74e12..66c14e2 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -193,6 +193,18 @@
e.stopPropagation();
that.switchList($list);
return;
+ case 9:
+ if(that.$element.is('[tabindex]')){
+ e.preventDefault();
+ var tabindex = parseInt(that.$element.attr('tabindex'), 10);
+ tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
+ $('[tabindex="'+(tabindex)+'"]').focus();
+ return;
+ }else{
+ if(e.shiftKey){
+ that.$element.trigger('focus');
+ }
+ }
}
if($.inArray(e.which, that.options.keySelect) > -1){
e.preventDefault();