Skip to content

Commit bf45e10

Browse files
author
Jelte Lagendijk
committed
Fix readonly attr & bump version
1 parent f94963e commit bf45e10

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "BootstrapRTE",
3-
"version": "3.2.0",
3+
"version": "3.3.0",
44
"description": "Basic Bootstrap Wysiwyg Editor",
55
"license": "Apache License, Version 2.0, January 2004",
66
"author": "",

src/BootstrapRTE/widget/BootstrapRTE.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,13 @@ define([
9797
logger.error(this.id + "Widget configuration error; Bootstrap RTE: Max size is smaller the Min Size");
9898
}
9999
},
100-
101-
_strReadOnly: function () {
100+
101+
_strReadOnly: function () {
102102
return this._contextObj.isReadonlyAttr && this._contextObj.isReadonlyAttr(this.attribute);
103103
},
104104

105105
update: function (obj, callback) {
106106

107-
if (this.readOnly || this.get("disabled") || this.readonly || this._strReadOnly()) {
108-
this._readOnly = true;
109-
}
110-
111107
if (!this._setup) {
112108
this._setupWidget(lang.hitch(this, this.update, obj, callback));
113109
return;
@@ -116,10 +112,14 @@ define([
116112
logger.debug(this.id + ".update");
117113

118114
if (obj) {
119-
this._mxObj = obj;
115+
this._contextObj = obj;
116+
117+
if (this.readOnly || this.get("disabled") || this.readonly || this._strReadOnly()) {
118+
this._readOnly = true;
119+
}
120120

121121
// set the content on update
122-
domHtml.set(this.inputNode, this._mxObj.get(this.attribute));
122+
domHtml.set(this.inputNode, this._contextObj.get(this.attribute));
123123
this._resetSubscriptions();
124124
} else {
125125
// Sorry no data no show!
@@ -190,21 +190,21 @@ define([
190190

191191
this.unsubscribeAll();
192192

193-
if (this._mxObj) {
193+
if (this._contextObj) {
194194
this.subscribe({
195-
guid: this._mxObj.getGuid(),
195+
guid: this._contextObj.getGuid(),
196196
callback: lang.hitch(this, this._loadData)
197197
});
198198

199199
// This doesn't work yet
200200
// this.subscribe({
201-
// guid: this._mxObj.getGuid(),
201+
// guid: this._contextObj.getGuid(),
202202
// attr: this.attribute,
203203
// callback: lang.hitch(this, this._loadData)
204204
// });
205205

206206
this.subscribe({
207-
guid: this._mxObj.getGuid(),
207+
guid: this._contextObj.getGuid(),
208208
val: true,
209209
callback: lang.hitch(this, this._handleValidation)
210210
});
@@ -229,7 +229,7 @@ define([
229229

230230
_loadData: function () {
231231
logger.debug(this.id + "._loadData");
232-
domHtml.set(this.inputNode, this._mxObj.get(this.attribute));
232+
domHtml.set(this.inputNode, this._contextObj.get(this.attribute));
233233
},
234234

235235
_createToolbar: function () {
@@ -308,16 +308,16 @@ define([
308308
_fetchContent: function () {
309309
logger.debug(this.id + "._fetchContent");
310310
var text = $(this.inputNode).html(),
311-
_valueChanged = (this._mxObj && this._mxObj.get(this.attribute) !== text);
311+
_valueChanged = (this._contextObj && this._contextObj.get(this.attribute) !== text);
312312

313-
this._mxObj.set(this.attribute, text);
313+
this._contextObj.set(this.attribute, text);
314314

315315
if (_valueChanged) {
316316
this._clearValidations();
317317
}
318318

319319
if (_valueChanged && this.onchangeMF !== "") {
320-
this._execMF(this._mxObj, this.onchangeMF);
320+
this._execMF(this._contextObj, this.onchangeMF);
321321
}
322322

323323
},

src/package.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<package xmlns="http://www.mendix.com/package/1.0/">
3-
<clientModule name="BootstrapRTE" version="3.2.0" xmlns="http://www.mendix.com/clientModule/1.0/">
3+
<clientModule name="BootstrapRTE" version="3.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
44
<widgetFiles>
55
<widgetFile path="BootstrapRTE/BootstrapRTE.xml"/>
66
</widgetFiles>

test/widgets/BootstrapRTE.mpk

40 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)