Skip to content

Commit

Permalink
Made sure only non capital characters are added when the enableCapita…
Browse files Browse the repository at this point in the history
…ls switch is off.
  • Loading branch information
Nick Jansen committed Nov 20, 2019
1 parent 9f071fd commit 875db1d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Binary file modified dist/custom.LabelSelect.mpk
Binary file not shown.
6 changes: 3 additions & 3 deletions src/LabelSelect/LabelSelect.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
<category>Behavior</category>
<description>Enable creating new labels.</description>
</property>
<property key="enableCaseSensitive" type="boolean" defaultValue='true'>
<caption>Enable case sensitivity</caption>
<property key="enableCapitals" type="boolean" defaultValue='true'>
<caption>Enable capital characters</caption>
<category>Behavior</category>
<description>Enable case sensitive labels.</description>
<description>Enable capital characters in labels.</description>
</property>
<property key="readOnly" type="boolean" defaultValue='false'>
<caption>Read Only</caption>
Expand Down
4 changes: 2 additions & 2 deletions src/LabelSelect/widget/LabelSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ define([
entity: this._tagEntity,
callback: lang.hitch(this, function(obj) {
//set the value
obj.set(this._tagAttribute, value);
this.enableCapitals ? obj.set(this._tagAttribute, value) : obj.set(this._tagAttribute, value.toLowerCase());
//save
mx.data.commit({
mxobj: obj,
Expand Down Expand Up @@ -291,7 +291,7 @@ define([
enableCreate: this.enableCreate,
showAutocompleteOnFocus: this.showAutoCompleteOnFocus,
removeConfirmation: false,
caseSensitive: this.enableCaseSensitive,
enableCapitals: this.enableCapitals,
allowDuplicates: false,
allowSpaces: false,
readOnly: this._readOnly,
Expand Down
Binary file modified test/widgets/custom.LabelSelect.mpk
Binary file not shown.

0 comments on commit 875db1d

Please sign in to comment.