Skip to content

Commit f508fd5

Browse files
committed
use of dojo dom modules, updated test project
1 parent 277c3d6 commit f508fd5

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/HTMLSnippet/widget/HTMLSnippet.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
/*jslint white: true nomen: true plusplus: true */
1+
/*jslint white: true, nomen: true, plusplus: true */
22
/*global mx, mxui, mendix, dojo, require, console, define, module */
33

44
require([
55
'dojo/_base/declare', 'mxui/widget/_WidgetBase',
6-
'mxui/dom', 'dojo/query', 'dojo/dom-prop', 'dojo/dom-style',
7-
'dojo/dom-attr'
8-
], function (declare, _WidgetBase, dom, domQuery, domProp, domStyle, domAttr) {
6+
'mxui/dom', 'dojo/dom-style', 'dojo/dom-attr', 'dojo/html'
7+
], function (declare, _WidgetBase, dom, domStyle, domAttr, html) {
98

109
'use strict';
1110

1211
// Declare widget.
1312
return declare('HTMLSnippet.widget.HTMLSnippet', [_WidgetBase], {
1413

14+
constructor: function () {
15+
},
16+
1517
// dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
1618
postCreate: function () {
1719
console.log(this.id + '.postCreate');
@@ -25,13 +27,13 @@ require([
2527
});
2628

2729
domAttr.set(this.domNode, 'style', this.style); //might override height and width
28-
this.domNode.innerHTML = this.contents;
30+
html.set(this.domNode, this.contents);
2931
break;
3032
case 'js':
3133
try {
3234
eval(this.contents);
3335
} catch (e) {
34-
dojo.html.set(this.domNode, "Error while evaluating JavaScript: " + e);
36+
html.set(this.domNode, "Error while evaluating JavaScript: " + e);
3537
}
3638
break;
3739
}

test/[Test] HTML JS Snippet.mpr

0 Bytes
Binary file not shown.

test/widgets/HTMLSnippet.mpk

-14 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)