From 209f33be23ae2a5e20f025d3d1fb6273762cd598 Mon Sep 17 00:00:00 2001 From: Fayland Lam Date: Thu, 22 Mar 2012 15:14:14 +0800 Subject: [PATCH 1/2] add clearValues --- Source/TextboxList.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 5f69556..8f388ab 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -216,6 +216,14 @@ var TextboxList = new Class({ if (v) this.add.apply(this, $type(v) == 'array' ? [v[1], v[0], v[2]] : [v]); }, this); }, + + clearValues: function() { + list.children().each(function(){ + var bit = getBit(this); + if (bit.toElement().attr('class').indexOf('deletable') > -1 ) + bit.remove(); + }); + }, update: function(){ this.original.set('value', this.options.encode(this.getValues())); @@ -433,4 +441,4 @@ TextboxListBit.Box = new Class({ this.bit.getChildren().addEvent('click', function(e){ e.stop(); }); } -}); \ No newline at end of file +}); From 2b55cae92dd1137e3569f6d99c755e0e9659addc Mon Sep 17 00:00:00 2001 From: Fayland Lam Date: Thu, 22 Mar 2012 15:16:47 +0800 Subject: [PATCH 2/2] fixes for syntax changes --- Source/TextboxList.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 8f388ab..590eeef 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -218,7 +218,7 @@ var TextboxList = new Class({ }, clearValues: function() { - list.children().each(function(){ + this.list.getChildren().map(function(){ var bit = getBit(this); if (bit.toElement().attr('class').indexOf('deletable') > -1 ) bit.remove();