@@ -23,53 +23,6 @@ Selectize.define('remove_button', function(options) {
23
23
append : true
24
24
} , options ) ;
25
25
26
- var singleClose = function ( thisRef , options ) {
27
-
28
- options . className = 'remove-single' ;
29
-
30
- var self = thisRef ;
31
- var html = '<a href="javascript:void(0)" class="' + options . className + '" tabindex="-1" title="' + escape_html ( options . title ) + '">' + options . label + '</a>' ;
32
-
33
- /**
34
- * Appends an element as a child (with raw HTML).
35
- *
36
- * @param {string } html_container
37
- * @param {string } html_element
38
- * @return {string }
39
- */
40
- var append = function ( html_container , html_element ) {
41
- return $ ( '<span>' ) . append ( html_container )
42
- . append ( html_element ) ;
43
- } ;
44
-
45
- thisRef . setup = ( function ( ) {
46
- var original = self . setup ;
47
- return function ( ) {
48
- // override the item rendering method to add the button to each
49
- if ( options . append ) {
50
- var id = $ ( self . $input . context ) . attr ( 'id' ) ;
51
- var selectizer = $ ( '#' + id ) ;
52
-
53
- var render_item = self . settings . render . item ;
54
- self . settings . render . item = function ( data ) {
55
- return append ( render_item . apply ( thisRef , arguments ) , html ) ;
56
- } ;
57
- }
58
-
59
- original . apply ( thisRef , arguments ) ;
60
-
61
- // add event listener
62
- thisRef . $control . on ( 'click' , '.' + options . className , function ( e ) {
63
- e . preventDefault ( ) ;
64
- if ( self . isLocked ) return ;
65
-
66
- self . clear ( ) ;
67
- } ) ;
68
-
69
- } ;
70
- } ) ( ) ;
71
- } ;
72
-
73
26
var multiClose = function ( thisRef , options ) {
74
27
75
28
var self = thisRef ;
@@ -117,10 +70,5 @@ Selectize.define('remove_button', function(options) {
117
70
} ) ( ) ;
118
71
} ;
119
72
120
- if ( this . settings . mode === 'single' ) {
121
- singleClose ( this , options ) ;
122
- return ;
123
- } else {
124
- multiClose ( this , options ) ;
125
- }
73
+ multiClose ( this , options ) ;
126
74
} ) ;
0 commit comments