[Tynstep-svn] r246 - trunk/step/step-web/src/main/webapp/js

ChrisBurrell at crosswire.org ChrisBurrell at crosswire.org
Thu Apr 19 06:42:58 MST 2012


Author: ChrisBurrell
Date: 2012-04-19 06:42:58 -0700 (Thu, 19 Apr 2012)
New Revision: 246

Modified:
   trunk/step/step-web/src/main/webapp/js/timeline.js
Log:
updating timeline 

Modified: trunk/step/step-web/src/main/webapp/js/timeline.js
===================================================================
--- trunk/step/step-web/src/main/webapp/js/timeline.js	2012-04-19 13:17:59 UTC (rev 245)
+++ trunk/step/step-web/src/main/webapp/js/timeline.js	2012-04-19 13:42:58 UTC (rev 246)
@@ -19,7 +19,8 @@
 	$(rootElement).hear("show-timeline", function(selfElement, data) {
 		self.passageId = data.passageId;
 		self.active = true;
-
+		self.linkToPassage = true;
+		
 		// first show the bottom pane...
 		if(!this.initialised) {
 			self.initAndLoad();
@@ -28,6 +29,12 @@
 		}
 				
 		$(window).resize(self.onResize);
+	});
+	
+	$(rootElement).hear("passage-changed", function(selfElement, data) {
+		if(self.initialised && self.linkToPassage) {
+			self.onLoad();
+		}
 	});	
 }
 
@@ -187,10 +194,8 @@
 	this.addToolbarButton(toolbar, "zoomInTimeline", "Zoom in", 'ui-icon-zoomin');
 	this.addToolbarButton(toolbar, "zoomOutTimeline", "Zoom out", 'ui-icon-zoomout');
 	this.addToolbarButton(toolbar, "scrollTimelineToDate", "Scroll to date", 'ui-icon-search');
-	this.addToolbarButton(toolbar, "linkToPassage", "Link passage", 'ui-icon-pin-s');
-
+	this.addToolbarButton(toolbar, "linkToPassage", "Unlink from passage", 'ui-icon-pin-s');
 	
-	
 	$("#bottomModuleHeader #scrollTimelineLeft").click(function() {
 			var mainBand = self.tl.getBand(0);
 			mainBand.scrollToCenter(mainBand.getMinVisibleDate());
@@ -204,11 +209,14 @@
 	$("#bottomModuleHeader #linkToPassage").click(function() {
 		if($(this).text() === "Link to passage") {
 			$(this).button("option", {icons: { primary: "ui-icon-pin-s" }, label: "Unlink from passage"});
+			self.linkToPassage = true;
 		} else {	
 			$(this).button("option", {icons: { primary: "ui-icon-pin-w" }, label: "Link to passage"});
-		}
+			self.linkToPassage = false;
+		}		
+	});
 	
-	});
+	
 };
 
 




More information about the Tynstep-svn mailing list