Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "LabelSelect",
"version": "4.5.7",
"version": "4.5.9",
"description": "With this widget you can easily create/assign/remove objects (for example labels) to/from an object.",
"license": "Apache-2",
"author": "",
Expand Down
28 changes: 5 additions & 23 deletions src/LabelSelect/widget/LabelSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ define([
_constructed: false,

postCreate: function() {
mx.logger.debug(this.id + ".postCreate :: 4.5.1");
//set the variables:
this._tagEntity = this.tagAssoc.split("/")[1];
this._refAttribute = this.tagAssoc.split("/")[0];
Expand All @@ -47,7 +46,6 @@ define([
},

update: function(obj, callback) {
mx.logger.debug(this.id + ".update");

if (!this._constructed) {
this._listBox = domConstruct.create("ul", {
Expand All @@ -68,7 +66,6 @@ define([
},

_fetchCurrentLabels: function(callback) {
mx.logger.debug(this.id + "._fetchCurrentLabels");
//fetch all referenced labels
var filters = {
attributes: [ this._tagAttribute ]
Expand Down Expand Up @@ -96,7 +93,6 @@ define([
},

_processTags: function(callback, objs) {
mx.logger.debug(this.id + "._processTags");
var refObjs = this._contextObj.get(this._refAttribute),
tagArray = [],
currentTags = [];
Expand All @@ -121,7 +117,6 @@ define([
},

_renderCurrentTags: function(currentTags, callback) {
mx.logger.debug(this.id + "._renderCurrentTags");
//we"re not using the plugin function "remove all" because we don"t want to remove references
var items = this._listBox.getElementsByTagName("li");
while (items.length > 0) {
Expand Down Expand Up @@ -150,18 +145,16 @@ define([
},

_startTagger: function(options) {
mx.logger.debug(this.id + "._startTagger");
if (options) {
$("#" + this.id + "_ListBox").tagit(options);
} else {
//fallback
mx.logger.warn("No options found, running defaults");
console.warn("No options found, running defaults");
$("#" + this.id + "_ListBox").tagit();
}
},

_createTagobject: function(value) {
mx.logger.debug(this.id + "._createTagobject");
//create a new tag
mx.data.create({
entity: this._tagEntity,
Expand All @@ -179,19 +172,17 @@ define([
if (this.aftercreatemf) {
this._execMf(this._contextObj, this.aftercreatemf);
} else {
console.log(this.id + " - please add an after create mf to commit the object, otherwise ui is incorrectly displayed.");
}
})
}, this);
}),
error: function(e) {
mx.logger.error("Error creating object: " + e);
console.error("Error creating object: " + e);
}
}, this);
},

_execMf: function(obj, mf, cb) {
mx.logger.debug(this.id + "._execMf : ", mf);
if (obj && mf) {
mx.data.action({
params: {
Expand All @@ -206,14 +197,13 @@ define([
}
},
error: function(e) {
mx.logger.error("Error running Microflow: " + e);
console.error("Error running Microflow: " + e);
}
}, this);
}
},

_resetSubscriptions: function() {
mx.logger.debug(this.id + "._resetSubscriptions");
this.unsubscribeAll();

if (this._contextObj) {
Expand Down Expand Up @@ -253,7 +243,6 @@ define([
},

_isReference: function(guid) {
mx.logger.debug(this.id + "._isReference");
var isRef = false,
refs = this._contextObj.getReferences(this._refAttribute);

Expand All @@ -268,10 +257,8 @@ define([

_saveObject: function() {
if (!this.saveOnAddTag) {
mx.logger.debug(this.id + "._saveObject skipped, save on add tags disabled");
return;
}
mx.logger.debug(this.id + "._saveObject");
var method = (!mx.version || mx.version && parseInt(mx.version.split(".")[0]) < 7) ? "save" : "commit";
mx.data[method]({
mxobj: this._contextObj,
Expand All @@ -282,7 +269,6 @@ define([
},

_setOptions: function(tagArray) {
mx.logger.debug(this.id + "._setOptions");
//TODO: allow users to set options
var options = {
availableTags: tagArray,
Expand Down Expand Up @@ -318,7 +304,7 @@ define([
} else if (this.enableCreate) {
this._createTagobject(ui.tagLabel);
} else {
mx.logger.warn("No Tag found for value: " + ui.tagLabel);
console.warn("No Tag found for value: " + ui.tagLabel);
}
}),

Expand All @@ -330,15 +316,14 @@ define([
this._contextObj.removeReferences(this._refAttribute, [tagObj.getGuid()]);
this._saveObject();
} else {
mx.logger.warn("No Tag found for value: " + ui.tagLabel);
console.warn("No Tag found for value: " + ui.tagLabel);
}
})
};
this._startTagger(options);
},

_handleValidation: function(validations) {
mx.logger.debug(this.id + "._handleValidation");
this._clearValidations();

var val = validations[0],
Expand All @@ -355,12 +340,10 @@ define([
},

_clearValidations: function() {
mx.logger.debug(this.id + "._clearValidations");
domConstruct.destroy(this._alertdiv);
},

_addValidation: function(msg) {
mx.logger.debug(this.id + "._addValidation");
this._alertdiv = domConstruct.create("div", {
"class": "alert alert-danger",
innerHTML: msg
Expand All @@ -370,7 +353,6 @@ define([
},

_executeCallback: function (cb, from) {
mx.logger.debug(this.id + "._executeCallback" + (from ? " from " + from : ""));
if (cb && typeof cb === "function") {
cb();
}
Expand Down
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="LabelSelect" version="4.5.7" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="LabelSelect" version="4.5.9" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="LabelSelect/LabelSelect.xml"/>
</widgetFiles>
Expand Down
Binary file modified test/widgets/LabelSelect.mpk
Binary file not shown.