`).get(0);
var marginEls = ppfx + marginName + '-el';
var paddingEls = ppfx + paddingName + '-el';
const fullMargName = `${marginEls} ${ppfx + marginName}`;
diff --git a/src/domain_abstract/ui/Input.js b/src/domain_abstract/ui/Input.js
index 4b382639d..c5f92dc32 100644
--- a/src/domain_abstract/ui/Input.js
+++ b/src/domain_abstract/ui/Input.js
@@ -58,11 +58,9 @@ module.exports = Backbone.View.extend({
*/
getInputEl() {
if(!this.inputEl) {
- this.inputEl = $('
', {
- type: 'text',
- class: this.inputCls,
- placeholder: this.model.get('defaults')
- });
+ const plh = this.model.get('defaults');
+ const cls = this.inputCls;
+ this.inputEl = $(`
`);
}
return this.inputEl.get(0);
},
diff --git a/src/domain_abstract/ui/InputColor.js b/src/domain_abstract/ui/InputColor.js
index a63830c4f..351584148 100644
--- a/src/domain_abstract/ui/InputColor.js
+++ b/src/domain_abstract/ui/InputColor.js
@@ -57,7 +57,7 @@ module.exports = Input.extend({
const self = this;
var model = this.model;
- var colorEl = $('
', {class: this.colorCls});
+ var colorEl = $(`
`);
var cpStyle = colorEl.get(0).style;
var elToAppend = this.target && this.target.config ? this.target.config.el : '';
diff --git a/src/domain_abstract/ui/InputNumber.js b/src/domain_abstract/ui/InputNumber.js
index 5b4aabfe7..733ce9794 100644
--- a/src/domain_abstract/ui/InputNumber.js
+++ b/src/domain_abstract/ui/InputNumber.js
@@ -101,11 +101,9 @@ module.exports = Backbone.View.extend({
*/
getInputEl() {
if(!this.inputEl) {
- this.inputEl = $('', {
- type: 'text',
- class: this.inputCls,
- placeholder: this.model.get('defaults')
- });
+ const cls = this.inputCls;
+ const plh = this.model.get('defaults');
+ this.inputEl = $(``);
}
return this.inputEl.get(0);
},
diff --git a/src/style_manager/view/PropertyCompositeView.js b/src/style_manager/view/PropertyCompositeView.js
index 2cd4a0eda..2f5f46a64 100644
--- a/src/style_manager/view/PropertyCompositeView.js
+++ b/src/style_manager/view/PropertyCompositeView.js
@@ -26,7 +26,7 @@ module.exports = PropertyView.extend({
if (props.length) {
if (!this.$input) {
- this.$input = $('', {value: 0, type: 'hidden' });
+ this.$input = $('');
this.input = this.$input.get(0);
}
diff --git a/src/style_manager/view/PropertyFileView.js b/src/style_manager/view/PropertyFileView.js
index ced75d896..8e8f30a43 100644
--- a/src/style_manager/view/PropertyFileView.js
+++ b/src/style_manager/view/PropertyFileView.js
@@ -36,7 +36,8 @@ module.exports = PropertyView.extend({
onRender() {
if (!this.$input) {
- this.$input = $('', {placeholder: this.model.getDefaultValue(), type: 'text' });
+ const plh = this.model.getDefaultValue();
+ this.$input = $(``);
}
if (!this.$preview) {
diff --git a/src/trait_manager/view/TraitView.js b/src/trait_manager/view/TraitView.js
index dd35f65f8..727e70cf1 100644
--- a/src/trait_manager/view/TraitView.js
+++ b/src/trait_manager/view/TraitView.js
@@ -81,21 +81,24 @@ module.exports = Backbone.View.extend({
var md = this.model;
var trg = this.target;
var name = md.get('name');
- var opts = {
- placeholder: md.get('placeholder') || md.get('default'),
- type: md.get('type') || 'text'
- };
- if(md.get('changeProp')){
- opts.value = trg.get(name);
- }else{
- var attrs = trg.get('attributes');
- opts.value = md.get('value') || attrs[name];
+ const plh = md.get('placeholder') || md.get('default');
+ const type = md.get('type') || 'text';
+ const attrs = trg.get('attributes');
+ const min = md.get('min');
+ const max = md.get('max');
+ const value = md.get('changeProp') ?
+ trg.get(name) : md.get('value') || attrs[name];
+ const input = $(``);
+
+ if (min) {
+ input.prop('min', min);
+ }
+
+ if (max) {
+ input.prop('max', max);
}
- if(md.get('min'))
- opts.min = md.get('min');
- if(md.get('max'))
- opts.max = md.get('max');
- this.$input = $('', opts);
+
+ this.$input = input;
}
return this.$input.get(0);
},
diff --git a/src/utils/Sorter.js b/src/utils/Sorter.js
index 877ebf3ae..72e59396e 100644
--- a/src/utils/Sorter.js
+++ b/src/utils/Sorter.js
@@ -1,4 +1,5 @@
-var Backbone = require('backbone');
+const Backbone = require('backbone');
+const $ = Backbone.$;
module.exports = Backbone.View.extend({