mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
input-pill: Add clean up functions.
This adds functions to remove pills and reset the state.
This commit is contained in:
committed by
Tim Abbott
parent
70a14d8b44
commit
5ae4b8d3f3
@@ -150,6 +150,14 @@ var input_pill = function ($parent) {
|
||||
}
|
||||
},
|
||||
|
||||
removeAllPills: function () {
|
||||
while (store.pills.length > 0) {
|
||||
this.removeLastPill();
|
||||
}
|
||||
|
||||
this.clear(store.$parent.find(".input"));
|
||||
},
|
||||
|
||||
// returns all data of the pills exclusive of their elements.
|
||||
data: function () {
|
||||
return store.pills.map(function (pill) {
|
||||
@@ -314,6 +322,8 @@ var input_pill = function ($parent) {
|
||||
validate: function (callback) {
|
||||
store.validation = callback;
|
||||
},
|
||||
|
||||
clear: funcs.removeAllPills.bind(funcs),
|
||||
};
|
||||
|
||||
return prototype;
|
||||
|
||||
Reference in New Issue
Block a user