1
- /*jslint white: true nomen: true plusplus: true */
1
+ /*jslint white: true, nomen: true, plusplus: true */
2
2
/*global mx, mxui, mendix, dojo, require, console, define, module */
3
3
4
4
require ( [
5
5
'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 ) {
9
8
10
9
'use strict' ;
11
10
12
11
// Declare widget.
13
12
return declare ( 'HTMLSnippet.widget.HTMLSnippet' , [ _WidgetBase ] , {
14
13
14
+ constructor : function ( ) {
15
+ } ,
16
+
15
17
// dijit._WidgetBase.postCreate is called after constructing the widget. Implement to do extra setup work.
16
18
postCreate : function ( ) {
17
19
console . log ( this . id + '.postCreate' ) ;
@@ -25,13 +27,13 @@ require([
25
27
} ) ;
26
28
27
29
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 ) ;
29
31
break ;
30
32
case 'js' :
31
33
try {
32
34
eval ( this . contents ) ;
33
35
} catch ( e ) {
34
- dojo . html . set ( this . domNode , "Error while evaluating JavaScript: " + e ) ;
36
+ html . set ( this . domNode , "Error while evaluating JavaScript: " + e ) ;
35
37
}
36
38
break ;
37
39
}
0 commit comments