Skip to content

Commit

Permalink
Added option to force native behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
jherencia committed Jun 26, 2015
1 parent 4e0b444 commit 9ccae35
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions _src/selectordie.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
linksExternal: false, // Boolean - false by default - Should the options be treated as links and open in a new window/tab?
size: 0, // Integer - 0 by default - The value set equals the amount of items before scroll is needed
tabIndex: 0, // integer - 0 by default
onChange: $.noop // Adds a callback function for when the SoD gets changed
onChange: $.noop, // Adds a callback function for when the SoD gets changed
forceNative: false // Forces native select
},
$_settings = {},
$_sodKeysWhenClosed = false,
Expand All @@ -60,6 +61,7 @@
$settingsSize = parseInt($select.data("size")) ? $select.data("size") : $_settings.size,
$settingsTabIndex = parseInt($select.data("tabindex")) ? $select.data("tabindex") : ( $_settings.tabIndex ? $_settings.tabIndex : ( $select.attr("tabindex") ? $select.attr("tabindex") : $_settings.tabIndex ) ),
$settingsStripEmpty = $select.data("strip-empty") ? $select.data("strip-empty") : $_settings.stripEmpty,
$forceNative = $select.data("force-native") ? $select.data("force-native") : $_settings.forceNative,
$selectTitle = $select.prop("title") ? $select.prop("title") : null,
$selectDisabled = $select.is(":disabled") ? " disabled" : "",
$sodPrefix = "",
Expand Down Expand Up @@ -97,7 +99,7 @@
}).insertAfter( this );

// If it's a touch device
if ( _private.isTouch() ) {
if ( _private.isTouch() || $forceNative ) {
$sod.addClass("touch");
}

Expand Down
Loading

0 comments on commit 9ccae35

Please sign in to comment.