Committer: dpetrov
Crop whitespaces to prevent adding unnecessary commas in tags textfield in update post pageU trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js =================================================================== --- trunk/htdocs/js/entry.js 2010-09-20 03:07:27 UTC (rev 17405) +++ trunk/htdocs/js/entry.js 2010-09-20 03:07:32 UTC (rev 17406) @@ -692,6 +692,8 @@ var inp = $('selecttags-all'), ary = inp.value.replace(/ */, '') ? inp.value.split(/ *, */) : [], i = -1; + + ary = jQuery.map( ary, function (val, idx) { return (val.length > 0) ? val : null } ); if (node.checked) { ary.push(node.value) } else { @@ -710,6 +712,7 @@ { var ary = $('selecttags-all').value.split(/ *, */), checkboxes = IPPUSelectTags.checkboxes; + ary = jQuery.map( ary, function (val, idx) { return (val.length > 0) ? val : null } ); checkboxes.attr('checked', false); while(ary.length) checkboxes.filter('[value='+ary.pop()+']').attr('checked', true); },