Skip to content

Commit 2e28bb6

Browse files
committed
Updated selectize.js to latest version.
1 parent ed24bd2 commit 2e28bb6

File tree

1 file changed

+17
-4
lines changed

1 file changed

+17
-4
lines changed

js/selectize.js

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@
583583
}));
584584

585585
/**
586-
* selectize.js (v0.8.0)
586+
* selectize.js (v0.8.1)
587587
* Copyright (c) 2013 Brian Reavis & contributors
588588
*
589589
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
@@ -1217,6 +1217,13 @@
12171217
self.ignoreHover = false;
12181218
});
12191219

1220+
// store original children and tab index so that they can be
1221+
// restored when the destroy() method is called.
1222+
this.revertSettings = {
1223+
$children : self.$input.children().detach(),
1224+
tabindex : self.$input.attr('tabindex')
1225+
};
1226+
12201227
self.$input.attr('tabindex', -1).hide().after(self.$wrapper);
12211228

12221229
if ($.isArray(settings.items)) {
@@ -1275,7 +1282,7 @@
12751282
},
12761283
'option_create': function(data, escape) {
12771284
return '<div class="create">Add <strong>' + escape(data.input) + '</strong>&hellip;</div>';
1278-
},
1285+
}
12791286
};
12801287

12811288
self.settings.render = $.extend({}, templates, self.settings.render);
@@ -2759,12 +2766,18 @@
27592766
destroy: function() {
27602767
var self = this;
27612768
var eventNS = self.eventNS;
2769+
var revertSettings = self.revertSettings;
27622770

27632771
self.trigger('destroy');
27642772
self.off();
27652773
self.$wrapper.remove();
27662774
self.$dropdown.remove();
2767-
self.$input.show();
2775+
2776+
self.$input
2777+
.html('')
2778+
.append(revertSettings.$children)
2779+
.attr({tabindex: revertSettings.tabindex})
2780+
.show();
27682781

27692782
$(window).off(eventNS);
27702783
$(document).off(eventNS);
@@ -3210,7 +3223,7 @@
32103223
label : '&times;',
32113224
title : 'Remove',
32123225
className : 'remove',
3213-
append : true,
3226+
append : true
32143227
}, options);
32153228

32163229
var self = this;

0 commit comments

Comments
 (0)