|
|
|
@ -170,6 +170,10 @@ export default Backbone.View.extend({ |
|
|
|
return targets || [this.getTarget()]; |
|
|
|
}, |
|
|
|
|
|
|
|
getFirstTarget() { |
|
|
|
return this.getTargets()[0]; |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Returns Styleable model |
|
|
|
* @return {Model|null} |
|
|
|
@ -212,7 +216,7 @@ export default Backbone.View.extend({ |
|
|
|
|
|
|
|
emitUpdateTarget: debounce(function() { |
|
|
|
const em = this.config.em; |
|
|
|
em && em.trigger('styleManager:update:target', this.getTarget()); |
|
|
|
em && em.trigger('styleManager:update:target', this.getFirstTarget()); |
|
|
|
}), |
|
|
|
|
|
|
|
_getTargetData() { |
|
|
|
@ -345,7 +349,7 @@ export default Backbone.View.extend({ |
|
|
|
getTargetValue(opts = {}) { |
|
|
|
let result; |
|
|
|
const { model } = this; |
|
|
|
const target = this.getTargets()[0]; |
|
|
|
const target = this.getFirstTarget(); |
|
|
|
const customFetchValue = this.customValue; |
|
|
|
|
|
|
|
if (!target) { |
|
|
|
@ -463,7 +467,7 @@ export default Backbone.View.extend({ |
|
|
|
*/ |
|
|
|
updateTargetStyle(value, name = '', opts = {}) { |
|
|
|
const property = name || this.model.get('property'); |
|
|
|
const target = opts.target || this.getTarget(); |
|
|
|
const target = opts.target || this.getFirstTarget(); |
|
|
|
const style = target.getStyle(); |
|
|
|
|
|
|
|
if (value) { |
|
|
|
@ -492,7 +496,7 @@ export default Backbone.View.extend({ |
|
|
|
* @return {Boolean} |
|
|
|
*/ |
|
|
|
isTargetStylable(target) { |
|
|
|
const trg = target || this.getTarget(); |
|
|
|
const trg = target || this.getFirstTarget(); |
|
|
|
const model = this.model; |
|
|
|
const id = model.get('id'); |
|
|
|
const property = model.get('property'); |
|
|
|
|