Skip to content

Commit

Permalink
Merge pull request #920 from peuter/fix-infotrigger
Browse files Browse the repository at this point in the history
use "long" values when "short"-ones are not set
  • Loading branch information
ChristianMayer committed Apr 3, 2019
2 parents af35ea0 + 7f817f7 commit 6be469f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions source/class/cv/parser/widgets/InfoTrigger.js
Expand Up @@ -49,10 +49,14 @@ qx.Class.define('cv.parser.widgets.InfoTrigger', {
getAttributeToPropertyMappings: function () {
return {
'downvalue': {target: 'downValue', transform: parseFloat, "default": 0},
'shortdownvalue': {target: 'shortDownValue', transform: parseFloat, "default": 0},
'shortdownvalue': {target: 'shortDownValue', transform: function (value) {
return !!value ? parseFloat(value) : null;
}},
'downlabel': {target: 'downLabel'},
'upvalue': {target: 'upValue', transform: parseFloat, "default": 0},
'shortupvalue': {target: 'shortUpValue', transform: parseFloat, "default": 0},
'shortupvalue': {target: 'shortUpValue', transform: function (value) {
return !!value ? parseFloat(value) : null;
}},
'uplabel': {target: 'upLabel'},
'shorttime': {target: 'shortThreshold', transform: parseFloat, "default": -1},
'change': {
Expand Down
6 changes: 3 additions & 3 deletions source/class/cv/ui/structure/pure/InfoTrigger.js
Expand Up @@ -46,7 +46,7 @@ qx.Class.define('cv.ui.structure.pure.InfoTrigger', {
},
'shortDownValue': {
check: "Number",
init: 0
nullable: true
},
'downLabel': {
check: "String",
Expand All @@ -58,7 +58,7 @@ qx.Class.define('cv.ui.structure.pure.InfoTrigger', {
},
'shortUpValue': {
check: "Number",
init: 0
nullable: true
},
'upLabel': {
check: "String",
Expand Down Expand Up @@ -158,7 +158,7 @@ qx.Class.define('cv.ui.structure.pure.InfoTrigger', {

__action: function (isShort, isDown) {
var value;
if (isShort) {
if (isShort && this.getShortDownValue() !== null && this.getShortUpValue() !== null) {
value = isDown ? this.getShortDownValue() : this.getShortUpValue();
} else {
value = isDown ? this.getDownValue() : this.getUpValue();
Expand Down

0 comments on commit 6be469f

Please sign in to comment.