can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r17406: Crop whitespaces to prevent adding unnec...

Committer: dpetrov
Crop whitespaces to prevent adding unnecessary commas in tags textfield in update post page
U   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);
 	},

Tags: can3p, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments