Skip to content

Commit

Permalink
Merge pull request #622 from peuter/fixes
Browse files Browse the repository at this point in the history
Several Bugfixes
  • Loading branch information
ChristianMayer committed Sep 21, 2017
2 parents 5de4d92 + 265ac7e commit 9e025a0
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9 deletions.
2 changes: 1 addition & 1 deletion source/class/cv/plugins/openhab/Openhab.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ qx.Class.define("cv.plugins.openhab.Openhab", {

// add a settings button to trigger opening the settings
var button = qx.dom.Element.create("div", {
html: cv.util.IconTools.svgKUF("edit_settings")(null, "width: 22px; height: 22px;"),
html: cv.util.IconTools.svgKUF("edit_settings")(null, 'style="width: 22px; height: 22px;"'),
style: "float: left;"
});
qx.dom.Element.insertBegin(button, qx.bom.Selector.query("#notification-center footer")[0]);
Expand Down
4 changes: 3 additions & 1 deletion source/class/cv/plugins/openhab/Settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ qx.Class.define("cv.plugins.openhab.Settings", {
switch(param.type) {
case "TEXT":
field = new qx.ui.form.TextField();
field.setPlaceholder(param.defaultValue);
if (param.defaultValue) {
field.setPlaceholder(param.defaultValue);
}
break;
case "BOOLEAN":
field = new qx.ui.form.CheckBox();
Expand Down
2 changes: 1 addition & 1 deletion source/class/cv/ui/structure/pure/Slide.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ qx.Class.define('cv.ui.structure.pure.Slide', {

this.addListener("changeVisible", function (ev) {
if (ev.getData() === true) {
this.__updateSlider();
new qx.util.DeferredCall(this.__updateSlider, this).schedule();
}
}, this);
if (this.isVisible()) {
Expand Down
14 changes: 14 additions & 0 deletions source/class/cv/ui/website/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ qx.Class.define('cv.ui.website.Slider', {
members: {
__pointerMoveEvent: null,

init: function() {
this.base(arguments);
if (this.getChildren(".ui-slider-range").length === 0) {
this.append(qx.ui.website.Widget.create("<div>")
.addClass("ui-slider-range"));
}
this.on("changePosition", function(pos) {
var knob = this.getChildren(".ui-slider-range");
var paddingLeft = Math.ceil(parseFloat(this.getStyle("paddingLeft")) || 0);
knob.setStyle("width", (pos+paddingLeft)+"px");
knob.setStyle("marginLeft", paddingLeft*-1+"px");
}, this);
},

// overridden
_getKnobContent: function() {
if (this.getFormat() && this.getValue() !== undefined) {
Expand Down
6 changes: 1 addition & 5 deletions source/class/cv/util/IconTools.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,11 @@ qx.Class.define('cv.util.IconTools', {
color = cv.util.IconTools.colorMapping[color];
}
var iconPath = qx.util.ResourceManager.getInstance().toUri('icon/knx-uf-iconset.svg');

var style = styling || "";
if (color) {
style += 'color:' + color + ';';
}
if (style) {
style = ' style="'+style+'" ';
}
return '<svg ' + style + 'class="' + classes + '"><use xlink:href="'+iconPath+'#kuf-' + iconID + '"></use></svg>';
return '<svg ' + style + ' class="' + classes + '"><use xlink:href="'+iconPath+'#kuf-' + iconID + '"></use></svg>';
};
}
},
Expand Down
2 changes: 1 addition & 1 deletion source/resource/designs/designglobals.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ body
-webkit-transform: translateZ(0);
-webkit-overflow-scrolling:touch;
}
.page > .clearfix { position:relative; }
.page > .clearfix { position:relative; height: 100%; }

/*
* colspans, each design needs to define a colspan0
Expand Down
1 change: 1 addition & 0 deletions source/resource/designs/metal/basic.css
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,7 @@ body br
height: 2.5rem;
cursor: default;
}
.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; top: 0; height: 100%; }

.ui-slider-horizontal { height: .8em; }
.ui-slider-horizontal .ui-slider-handle { top: -.7em; }
Expand Down

0 comments on commit 9e025a0

Please sign in to comment.