summaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorBerend <please@frique.me>2013-08-26 01:37:20 +0700
committerBerend <please@frique.me>2013-08-26 01:37:20 +0700
commit7149be47a46f2f4e558e6afed4ab794a709cd0b0 (patch)
tree3f37ee543ea5ca027342486ee370237427ddf92a /js
parent419a506b18a99736998a7e71e7ba0c28e98dd2c2 (diff)
downloadmulti-select-7149be47a46f2f4e558e6afed4ab794a709cd0b0.zip
multi-select-7149be47a46f2f4e558e6afed4ab794a709cd0b0.tar.gz
multi-select-7149be47a46f2f4e558e6afed4ab794a709cd0b0.tar.bz2
Makes tabbing in/out of the control also work in IE
Follows tabindex attribute when using the tab / shift-tab keys through the form.
Diffstat (limited to 'js')
-rw-r--r--js/jquery.multi-select.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/js/jquery.multi-select.js b/js/jquery.multi-select.js
index f8e70a9..65d64cf 100644
--- a/js/jquery.multi-select.js
+++ b/js/jquery.multi-select.js
@@ -199,8 +199,16 @@
that.switchList($list);
return;
case 9:
- if(e.shiftKey){
- that.$element.trigger('focus');
+ 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');
+ }
}
}
});