amalgame/commit

record and pass info on whether the selected mapping is a reference mapping or not

authorJacco van Ossenbruggen
Wed Jul 30 12:32:18 2014 +0200
committerJacco van Ossenbruggen
Wed Jul 30 12:32:18 2014 +0200
commit5f262d70d87aa5f4e73ff198cfc41bb9969d8d70
treeb728c246d0e9f1f52a45f54afaa1da418217e567
parent5f3e33d41a5762482dc9134d86f2550405280824
Diff style: patch stat
diff --git a/web/js/mappinglist.js b/web/js/mappinglist.js
index 3bb3cbe..772034e 100644
--- a/web/js/mappinglist.js
+++ b/web/js/mappinglist.js
@@ -48,11 +48,10 @@ YUI.add('mappinglist', function(Y) {
 
 		_onSelectChange : function(e) {
 			var uri = e.newVal;
-
 			Y.log('mappinglist :: select '+uri);
 			this.set("selected", uri);
-			this._toggleSelection();
-			this.fire("mappingSelect", {uri:uri});
+			var isReference = this._toggleSelection();
+			this.fire("mappingSelect", {uri:uri, isReference:isReference});
 		},
 
 		_setMappings : function() {
@@ -79,13 +78,18 @@ YUI.add('mappinglist', function(Y) {
 		},
 
 		_toggleSelection : function() {
+			var isReference = false;
 			var nodes = this.listNode.all("tr.row");
 			nodes.removeClass("selected");
 			var sel = this.get("selected");
 			if(sel) { 
 				var selRow = this.listNode.one('tr[title='+sel+']')
-				if (selRow) selRow.addClass("selected"); 
+				if (selRow) {
+					selRow.addClass("selected");
+					isReference = selRow.hasClass("reference");
+				}
 			}
+			return isReference;
 		},
 	});