File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -119,6 +119,8 @@ $.fn.selectize = function(settings_user) {
119
119
} ;
120
120
121
121
return this . each ( function ( ) {
122
+ if ( this . selectize ) return ;
123
+
122
124
var instance ;
123
125
var $input = $ ( this ) ;
124
126
var tag_name = this . tagName . toLowerCase ( ) ;
Original file line number Diff line number Diff line change 2
2
3
3
describe ( 'Setup' , function ( ) {
4
4
5
+ it ( 'should not allow duplicate initialization' , function ( ) {
6
+ var instance_before , instance_after , test ;
7
+
8
+ test = setup_test ( '<input type="text">' , { } ) ;
9
+ instance_before = test . $select [ 0 ] . selectize ;
10
+ test . $select . selectize ( ) ;
11
+ instance_after = test . $select [ 0 ] . selectize ;
12
+
13
+ expect ( instance_before ) . to . be . equal ( instance_after ) ;
14
+ } ) ;
15
+
5
16
describe ( '<input type="text">' , function ( ) {
6
17
it ( 'complete without exceptions' , function ( ) {
7
18
var test = setup_test ( '<input type="text">' , { } ) ;
You can’t perform that action at this time.
0 commit comments