Skip to content

Instantly share code, notes, and snippets.

View IPKISS's full-sized avatar
🏠
Working from home

Sebastian IPKISS

🏠
Working from home
View GitHub Profile
@IPKISS
IPKISS / gist:31913c309fc76568bcc9
Created March 31, 2015 11:21
Plugin for selectize.js that will add empty option to dropdown
Selectize.define( 'empty_option', function ( options ) {
var self = this;
self.setup = (function () {
var original = self.setup;
return function () {
original.apply( this, arguments );
this.$dropdown.prepend('<div data-value="" data-selectable="false" class="option null"></div>');
this.$dropdown.on( 'mousedown', '.null', function ( e ) {
self.setValue( '' );