Skip to content

Commit

Permalink
Replace getValue with getFullValue within view properties
Browse files Browse the repository at this point in the history
  • Loading branch information
artf committed Sep 13, 2017
1 parent 577c144 commit 496f461
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
14 changes: 4 additions & 10 deletions src/style_manager/view/PropertyCompositeView.js
Expand Up @@ -130,16 +130,10 @@ module.exports = PropertyView.extend({
* @return {string}
* */
build(selectedEl, propertyView, opts) {
var result = '';
this.model.get('properties').each(prop => {
var v = prop.getValue();
var func = prop.get('functionName');

if(func)
v = func + '(' + v + ')';

result += v + ' ';
});
let result = '';
this.model.get('properties').each(prop =>
result += `${prop.getFullValue()} `
);
return result.replace(/ +$/,'');
},

Expand Down
8 changes: 2 additions & 6 deletions src/style_manager/view/PropertyStackView.js
Expand Up @@ -143,14 +143,10 @@ module.exports = PropertyCompositeView.extend({
return;

// Store properties values inside layer, in this way it's more reliable
// to fetch them later
// to fetch them later
var valObj = {};
this.model.get('properties').each(prop => {
var v = prop.getValue(),
func = prop.get('functionName');
if(func)
v = func + '(' + v + ')';
valObj[prop.get('property')] = v;
valObj[prop.get('property')] = prop.getFullValue();
});
model.set('values', valObj);

Expand Down
7 changes: 1 addition & 6 deletions src/style_manager/view/PropertyView.js
Expand Up @@ -372,12 +372,7 @@ module.exports = Backbone.View.extend({
return;
}

var value = this.getValueForTarget();

var func = model.get('functionName');
if(func)
value = func + '(' + value + ')';

const value = this.model.getFullValue();
var target = this.getTarget();
var onChange = this.onChange;

Expand Down

0 comments on commit 496f461

Please sign in to comment.