fhem-tablet-ui
fhem-tablet-ui copied to clipboard
Allow user defined title for departure widget
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.