From e4887ce12c1228c0230e0a4f30d687d8a94bb955 Mon Sep 17 00:00:00 2001
From: 2deep4real <denis.peters@udo.edu>
Date: Tue, 15 Sep 2015 00:46:13 +0200
Subject: [PATCH] linenumberWidth = timeWidth + delayWidth

---
 panels/departure/script.js  | 12 ++++++++----
 panels/departure/style.less |  2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/panels/departure/script.js b/panels/departure/script.js
index 167826a..0fa0ae6 100755
--- a/panels/departure/script.js
+++ b/panels/departure/script.js
@@ -169,12 +169,16 @@ var resize = function(panel, config, cont) {
 		lineHedH	= scale * 5,		// überschriften der linien
 		lineStpH	= scale * 4,		// haltestellen der linien
 		infoTtlH	= scale * 6,		// überschriften der informationen
-		infoMsgH	= scale * 5;		// die eigentliche nachricht der information
+		infoMsgH	= scale * 5,		// die eigentliche nachricht der information
+		// berechne string breite
+		timeWidth	= getStringWidth((lineStpH-2), "00:00"),
+		delayWidth	= getStringWidth((lineStpH-2), "+00");
+	
 	// setze linien überschriften größe
 	$(lineHed).css('height', lineHedH + 'px');
 	$(lineHed).css('fontSize', (lineHedH-2) + 'px');
 	$(lineHed).css('lineHeight', lineHedH + 'px');
-	$(lineLin).css('width', getStringWidth((lineHedH-2), "00000"));
+	$(lineLin).css('width', timeWidth + delayWidth);
 
 	// setze linien haltestellen größe
 	$(lineStp).css('height', lineStpH + 'px');
@@ -182,8 +186,8 @@ var resize = function(panel, config, cont) {
 	$(lineStp).css('lineHeight', lineStpH + 'px');
 	
 	// setze zeit und delay breite
-	$(stopTme).css('width', getStringWidth((lineStpH-2), "00:00") + 'px');
-	$(stopDly).css('width', getStringWidth((lineStpH-2), "+00") + 'px');
+	$(stopTme).css('width', timeWidth + 'px');
+	$(stopDly).css('width', delayWidth + 'px');
 	
 	// setze info überschriften größe
 	$(infoTtl).css('height', infoTtlH + 'px');
diff --git a/panels/departure/style.less b/panels/departure/style.less
index 690ddae..c4a59b4 100755
--- a/panels/departure/style.less
+++ b/panels/departure/style.less
@@ -71,7 +71,7 @@
 					position: relative;
 					height: 100%;
 					overflow: hidden;
-					text-align: right;
+					text-align: left;
 					padding: 0px 5px 0px 0px;
 					font-weight: bold;
 					color: #B8860B;
-- 
GitLab