Skip to content

Commit

Permalink
fix textinput UI readonly option. Fixes #1280
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Oct 15, 2016
1 parent bf9b50b commit 8b726d7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions app/core/uis/textinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ define(['app', 'core/UIComponent', 'core/UIView', 'core/t'], function(app, UICom
}
},

// afterRender gets called after the template is rendered
afterRender: function() {
if (this.options.settings.get("readonly") === "on") this.$("input").prop("readonly",true);
},

// Called before template is rendered, serialize returns an object that gets used as data for template string
serialize: function() {
var length = this.maxCharLength;
Expand All @@ -69,7 +64,7 @@ define(['app', 'core/UIComponent', 'core/UIView', 'core/t'], function(app, UICom
maxLength: length,
characters: length - value.toString().length,
comment: this.options.schema.get('comment'),
readonly: ((this.options.settings && this.options.settings.get('readonly') === "1") || !this.options.canWrite),
readonly: ((this.options.settings && this.options.settings.get('readonly') === true) || !this.options.canWrite),
placeholder: (this.options.settings) ? this.options.settings.get('placeholder_text') : ''
};
},
Expand Down

0 comments on commit 8b726d7

Please sign in to comment.