Skip to content

Commit

Permalink
Merge pull request #921 from peuter/fix-reload
Browse files Browse the repository at this point in the history
- parse address in reload element
  • Loading branch information
ChristianMayer committed Apr 6, 2019
2 parents 6be469f + acdfdfc commit 5a2cae8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion source/class/cv/parser/widgets/Reload.js
Expand Up @@ -40,7 +40,9 @@ qx.Class.define('cv.parser.widgets.Reload', {
* @param pageType {String} Page type (2d, 3d, ...)
*/
parse: function (xml, path, flavour, pageType) {
return cv.parser.WidgetParser.parseElement(this, xml, path, flavour, pageType);
var data = cv.parser.WidgetParser.parseElement(this, xml, path, flavour, pageType);
cv.parser.WidgetParser.parseAddress(xml, path);
return data;
}
},

Expand Down
3 changes: 2 additions & 1 deletion source/class/cv/ui/structure/pure/Reload.js
Expand Up @@ -46,7 +46,8 @@ qx.Class.define('cv.ui.structure.pure.Reload', {
return;
},

handleUpdate: function (value) {
_update: function (address, data) {
var value = this.defaultValueHandling(address, data);
if (value > 0) {
cv.util.Location.reload(true);
}
Expand Down
6 changes: 3 additions & 3 deletions source/test/karma/ui/structure/pure/Reload-spec.js
Expand Up @@ -30,11 +30,11 @@ describe("testing a reload widget", function() {
});

it("should test the reload action", function() {
var widgetInstance = this.createTestElement("reload");
var widgetInstance = this.createTestElement("reload", null, null, '1/0/0');
spyOn(cv.util.Location, "reload");
widgetInstance.handleUpdate(0);
widgetInstance._update('1/0/0', 0);
expect(cv.util.Location.reload).not.toHaveBeenCalled();
widgetInstance.handleUpdate(1);
widgetInstance._update('1/0/0', 1);
expect(cv.util.Location.reload).toHaveBeenCalledWith(true);
});
});
1 change: 0 additions & 1 deletion source/test/karma/ui/structure/pure/Trigger-spec.js
Expand Up @@ -213,7 +213,6 @@ describe("testing a trigger", function() {
type: "pointerup"
}));
Reg.fireEvent(actor, "pointerup", qx.event.type.Pointer, [nativeEvent, actor, actor, true, true]);
qx.event.Registration.fireEvent(actor, "tap", qx.event.type.Event, []);
expect(actor).not.toHaveClass("switchPressed");
expect(actor).toHaveClass("switchUnpressed");

Expand Down

0 comments on commit 5a2cae8

Please sign in to comment.