Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow user defined title for departure widget #188

Open
javrucebo opened this issue Jan 3, 2017 · 0 comments
Open

Allow user defined title for departure widget #188

javrucebo opened this issue Jan 3, 2017 · 0 comments

Comments

@javrucebo
Copy link

Adding optional user defined title for departure widget.
This allows for example to use spaces such that title shows Bahnhof Essen instead of Bahnhof-Essen

--- a/www/tablet/js/widget_departure.js
+++ b/www/tablet/js/widget_departure.js
@@ -34,6 +34,7 @@ var Modul_departure = function () {
     function init_attr(elem) {
         elem.initData('get', 'STATE');
         elem.initData('cmd', 'get');
+        elem.initData('title', elem.data('get'));
         elem.initData('color', ftui.getClassColor(elem) || ftui.getStyle('.' + me.widgetname, 'color') || '#222');
         elem.initData('background-color', ftui.getStyle('.' + me.widgetname, 'background-color') || '#C0C0C0');
         elem.initData('icon-color', ftui.getStyle('.' + me.widgetname, 'icon-color') || '#aa6900');
@@ -78,7 +79,7 @@ var Modul_departure = function () {
         $('<div/>', {
                 class: 'station',
             })
-            .text(elem.data('get'))
+            .text(elem.data('title'))
             .appendTo(elem);
 
         // prepare refresh element

to use the feature just add data-title="Bahnhof Essen" in your html file when setting up the departure widget.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant