Last active
April 22, 2016 16:09
-
-
Save biesbjerg/bb28ba80862d57306a0e to your computer and use it in GitHub Desktop.
Fix for Selectize and FastClick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PLUGIN (save as selectize-fast-click.js and load after selectize.js): | |
------------------------------------------------------ | |
Selectize.define('fast_click', function(options) { | |
var self = this; | |
this.render = (function() { | |
var original = self.render; | |
return function(templateName, data) { | |
var html = original.apply(this, arguments); | |
var $output = $(html).addClass('needsclick'); | |
return $output.get(0).outerHTML; | |
}; | |
})(); | |
}); | |
USAGE: | |
------------------------------------------------------ | |
$('select').selectize({ | |
plugins: ['fast_click'] | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Perfectly working, thanks man!