Browse Source

Add allowtab setting, to enable/disable dropdown tabbing

pull/1129/head
jlukic 10 years ago
parent
commit
2277085fcd
2 changed files with 19 additions and 15 deletions
  1. 3
      server/files/javascript/semantic.js
  2. 31
      src/definitions/modules/dropdown.js

3
server/files/javascript/semantic.js

@ -668,7 +668,8 @@ semantic.ready = function() {
$menuDropdown
.dropdown({
on : 'hover',
action : 'nothing'
action : 'nothing',
allowTab : false
})
;

31
src/definitions/modules/dropdown.js

@ -112,26 +112,28 @@ $.fn.dropdown = function(parameters) {
.insertBefore($text)
;
}
if( module.is.searchable() ) {
module.debug('Searchable dropdown initialized');
$search
.val('')
.attr('tabindex', 0)
;
$menu
.attr('tabindex', '-1')
;
}
else {
module.debug('Simple selection dropdown initialized');
if(!$module.attr('tabindex') ) {
$module
if(settings.allowTab) {
if( module.is.searchable() ) {
module.debug('Searchable dropdown initialized');
$search
.val('')
.attr('tabindex', 0)
;
$menu
.attr('tabindex', '-1')
;
}
else {
module.debug('Simple selection dropdown initialized');
if(!$module.attr('tabindex') ) {
$module
.attr('tabindex', 0)
;
$menu
.attr('tabindex', '-1')
;
}
}
}
},
select: function() {
@ -1279,6 +1281,7 @@ $.fn.dropdown.settings = {
on : 'click',
action : 'activate',
allowTab : true,
fullTextSearch : true,
preserveHTML : true,

Loading…
Cancel
Save