can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r19585: LJSUP-9370: js error when click button "...

Committer: dpetrov
LJSUP-9370: js error when click button "Select tags"
U   trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2011-08-04 02:07:47 UTC (rev 19584)
+++ trunk/htdocs/js/entry.js	2011-08-04 03:51:26 UTC (rev 19585)
@@ -742,13 +742,20 @@
 
 	input: function(){
 		var ary = $('selecttags-all').value.split(/ *, */),
-			checkboxes = IPPUSelectTags.checkboxes;
+			checkboxes = IPPUSelectTags.checkboxes,
+			tag;
 		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);
+			tag = ary.pop();
+			try {
+				//if tag contains nonalpha chars, this may easily fall
+				checkboxes.filter('[value=' + tag + ']').attr('checked', true);
+			} catch(e) {
+				checkboxes.filter( function() { return this.value === tag; } ).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