Skip to content

Commit a63c449

Browse files
committed
Fix: remove 'singleClose' from 'remove_plugin' assumed now by 'clear_button'
1 parent 6952310 commit a63c449

File tree

2 files changed

+1
-60
lines changed

2 files changed

+1
-60
lines changed

src/plugins/remove_button/plugin.js

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -23,53 +23,6 @@ Selectize.define('remove_button', function(options) {
2323
append : true
2424
}, options);
2525

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-
7326
var multiClose = function(thisRef, options) {
7427

7528
var self = thisRef;
@@ -117,10 +70,5 @@ Selectize.define('remove_button', function(options) {
11770
})();
11871
};
11972

120-
if (this.settings.mode === 'single') {
121-
singleClose(this, options);
122-
return;
123-
} else {
124-
multiClose(this, options);
125-
}
73+
multiClose(this, options);
12674
});

src/plugins/remove_button/plugin.scss

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,4 @@
3535
$select-lighten-disabled-item-border
3636
);
3737
}
38-
39-
.remove-single {
40-
position: absolute;
41-
right: 0;
42-
top: 0;
43-
font-size: 23px;
44-
}
4538
}

0 commit comments

Comments
 (0)