From 7f6972cec7db5216c1a42f0ebce3adacdbf70e88 Mon Sep 17 00:00:00 2001 From: Silvio Moreto Date: Fri, 26 Oct 2012 18:57:43 -0200 Subject: [PATCH] Edit to dont add if the value is empty --- Source/TextboxList.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Source/TextboxList.js b/Source/TextboxList.js index 17927bb..65141c9 100644 --- a/Source/TextboxList.js +++ b/Source/TextboxList.js @@ -427,14 +427,16 @@ $.TextboxListBit = function(type, value, textboxlist, _options){ }; var toBox = function(){ - var value = self.getValue(); - var b = textboxlist.create('box', value); - if (b){ - b.inject(bit, 'before'); - self.setValue([null, '', null]); - return b; + if (value[1].length > 0) { + var value = self.getValue(); + var b = textboxlist.create('box', value); + if (b){ + b.inject(bit, 'before'); + self.setValue([null, '', null]); + return b; + } + return null; } - return null; }; this.toBox = toBox;