Палсеич— (lusever) wrote in changelog,
Палсеич—
lusever
changelog

[livejournal] r17529: LJSV-1217: edittags.bml keyboard interfa...

Committer: pkornilov
LJSV-1217: edittags.bml keyboard interface behaves unexpectedly.
LJSV-1013: Edit Tags on Entry page no longer allows selecting by typing.
U   trunk/htdocs/js/tags.js
Modified: trunk/htdocs/js/tags.js
===================================================================
--- trunk/htdocs/js/tags.js	2010-10-11 04:59:00 UTC (rev 17528)
+++ trunk/htdocs/js/tags.js	2010-10-11 07:12:06 UTC (rev 17529)
@@ -180,8 +180,8 @@
 		});
 		
 		$list.bind(jQuery.browser.msie ?
-		    'change' : // IE support metaKey in onchange
-		    'click keyup', EditTag.select)
+			'change' : // IE support metaKey in onchange
+			'click keyup', EditTag.select);
 	},
 	
 	select: function(e)
@@ -200,7 +200,20 @@
 			cur_tags = tagfield.value.split(/,\s*/),
 			i, tag;
 		
-		if (e.metaKey) {
+		if (e.type === 'keyup') {
+			var index,
+				top = this.scrollTop; // jump to last element in FF 3.6
+			
+			for (i = -1; selected[++i];) {
+				cache_list[selected[i]].selected = false;
+			}
+			selected = [];
+			for (i = -1; cur_tags[++i];) {
+				cache_list[cur_tags[i]].selected = true;
+			}
+			
+			this.scrollTop = top;
+		} else if (e.metaKey) {
 			i = cur_tags.length;
 			while (i--) {
 				tag = cur_tags[i];

Tags: js, livejournal, lusever
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