Skip to content

Commit

Permalink
Merge pull request #11 from mendix/bugfix/extra-unneeded-div
Browse files Browse the repository at this point in the history
Bugfix/extra unneeded div
  • Loading branch information
Osama Mohammad Najjar authored Feb 4, 2019
2 parents 8239611 + 8b75785 commit 139a7fe
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "DynamicImage",
"version": "5.0.1",
"version": "5.0.2",
"description": "",
"license": "",
"author": "",
Expand Down
15 changes: 9 additions & 6 deletions src/DynamicImage/widget/DynamicImage.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
define([
"dojo/_base/declare",
"mxui/widget/_WidgetBase",
"dijit/_TemplatedMixin",
"dojo/dom-class",
"dojo/dom-attr",
"dojo/dom-style",
"dojo/_base/lang",
"dojo/on",
"dojo/dom-construct",
"DynamicImage/widget/ImageNode"
], function (declare, _WidgetBase, domClass, domStyle, lang, on, domConstruct, CreateImageNode) {
"dojo/text!DynamicImage/widget/template/DynamicImage.html"
], function (declare, _WidgetBase, _TemplatedMixin,domClass, domAttr, domStyle, lang, on, widgetTemplate) {
"use strict";

return declare("DynamicImage.widget.DynamicImage", [_WidgetBase], {
return declare("DynamicImage.widget.DynamicImage", [_WidgetBase,_TemplatedMixin], {

_contextObj: null,
_clickHandler: null,
_imageNode: null,
templateString: widgetTemplate,

postCreate: function () {
logger.debug(this.id + ".postCreate");
this._imageNode = CreateImageNode(this.defaultImage, this.alt);
domConstruct.place(this._imageNode, this.domNode);
domAttr.set(this._imageNode,"src",this.defaultImage || "");
domAttr.set(this._imageNode,"alt",this.alt || "");
},
update: function (obj, callback) {
logger.debug(this.id + ".update");
Expand Down
14 changes: 8 additions & 6 deletions src/DynamicImage/widget/StaticImage.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
define([
"dojo/_base/declare",
"mxui/widget/_WidgetBase",
"dijit/_TemplatedMixin",
"dojo/_base/lang",
"dojo/dom-construct",
"DynamicImage/widget/ImageNode"
], function (declare, _WidgetBase, lang, domConstruct, CreateImageNode) {
"dojo/text!DynamicImage/widget/template/DynamicImage.html"
], function (declare, _WidgetBase, _TemplatedMixin,lang, widgetTemplate) {
"use strict";

return declare("DynamicImage.widget.StaticImage", [_WidgetBase], {
return declare("DynamicImage.widget.StaticImage", [_WidgetBase,_TemplatedMixin], {

_contextObj: null,
_imageNode: null,
templateString: widgetTemplate,

postCreate: function () {
logger.debug(this.id + ".postCreate");
this._imageNode = CreateImageNode(this.defaultImage, this.alt);
domConstruct.place(this._imageNode, this.domNode);
domAttr.set(this._imageNode,"src",this.defaultImage || "");
domAttr.set(this._imageNode,"alt",this.alt || "");
},
update: function (obj, callback) {
logger.debug(this.id + ".update");
Expand Down
1 change: 1 addition & 0 deletions src/DynamicImage/widget/template/DynamicImage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<img data-dojo-attach-point="_imageNode" >
2 changes: 1 addition & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="DynamicImage" version="5.0.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="DynamicImage" version="5.0.2" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="DynamicImage/DynamicImage.xml"/>
<widgetFile path="DynamicImage/StaticImage.xml"/>
Expand Down
Binary file modified test/[Test] DynamicImageViewer.mpr
Binary file not shown.
Binary file modified test/widgets/DynamicImage.mpk
Binary file not shown.

0 comments on commit 139a7fe

Please sign in to comment.