File tree Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Expand file tree Collapse file tree 1 file changed +17
-4
lines changed Original file line number Diff line number Diff line change 583
583
} ) ) ;
584
584
585
585
/**
586
- * selectize.js (v0.8.0 )
586
+ * selectize.js (v0.8.1 )
587
587
* Copyright (c) 2013 Brian Reavis & contributors
588
588
*
589
589
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
1217
1217
self . ignoreHover = false ;
1218
1218
} ) ;
1219
1219
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
+
1220
1227
self . $input . attr ( 'tabindex' , - 1 ) . hide ( ) . after ( self . $wrapper ) ;
1221
1228
1222
1229
if ( $ . isArray ( settings . items ) ) {
1275
1282
} ,
1276
1283
'option_create' : function ( data , escape ) {
1277
1284
return '<div class="create">Add <strong>' + escape ( data . input ) + '</strong>…</div>' ;
1278
- } ,
1285
+ }
1279
1286
} ;
1280
1287
1281
1288
self . settings . render = $ . extend ( { } , templates , self . settings . render ) ;
2759
2766
destroy : function ( ) {
2760
2767
var self = this ;
2761
2768
var eventNS = self . eventNS ;
2769
+ var revertSettings = self . revertSettings ;
2762
2770
2763
2771
self . trigger ( 'destroy' ) ;
2764
2772
self . off ( ) ;
2765
2773
self . $wrapper . remove ( ) ;
2766
2774
self . $dropdown . remove ( ) ;
2767
- self . $input . show ( ) ;
2775
+
2776
+ self . $input
2777
+ . html ( '' )
2778
+ . append ( revertSettings . $children )
2779
+ . attr ( { tabindex : revertSettings . tabindex } )
2780
+ . show ( ) ;
2768
2781
2769
2782
$ ( window ) . off ( eventNS ) ;
2770
2783
$ ( document ) . off ( eventNS ) ;
3210
3223
label : '×' ,
3211
3224
title : 'Remove' ,
3212
3225
className : 'remove' ,
3213
- append : true ,
3226
+ append : true
3214
3227
} , options ) ;
3215
3228
3216
3229
var self = this ;
You can’t perform that action at this time.
0 commit comments