|
|
@ -5,17 +5,15 @@ export default Backbone.View.extend({ |
|
|
submit: 'handleSubmit' |
|
|
submit: 'handleSubmit' |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
template(view) { |
|
|
template({ pfx, ppfx, em, ...view }) { |
|
|
const pfx = view.pfx; |
|
|
|
|
|
const ppfx = view.ppfx; |
|
|
|
|
|
return ` |
|
|
return ` |
|
|
<div class="${pfx}assets-cont"> |
|
|
<div class="${pfx}assets-cont"> |
|
|
<div class="${pfx}assets-header"> |
|
|
<div class="${pfx}assets-header"> |
|
|
<form class="${pfx}add-asset"> |
|
|
<form class="${pfx}add-asset"> |
|
|
<div class="${ppfx}field ${pfx}add-field"> |
|
|
<div class="${ppfx}field ${pfx}add-field"> |
|
|
<input placeholder="${view.config.inputPlaceholder}"/> |
|
|
<input placeholder="${em.t('assets.inputPlh')}"/> |
|
|
</div> |
|
|
</div> |
|
|
<button class="${ppfx}btn-prim">${view.config.addBtnText}</button> |
|
|
<button class="${ppfx}btn-prim">${em.t('assets.addButton')}</button> |
|
|
<div style="clear:both"></div> |
|
|
<div style="clear:both"></div> |
|
|
</form> |
|
|
</form> |
|
|
</div> |
|
|
</div> |
|
|
@ -30,6 +28,7 @@ export default Backbone.View.extend({ |
|
|
this.config = o.config; |
|
|
this.config = o.config; |
|
|
this.pfx = this.config.stylePrefix || ''; |
|
|
this.pfx = this.config.stylePrefix || ''; |
|
|
this.ppfx = this.config.pStylePrefix || ''; |
|
|
this.ppfx = this.config.pStylePrefix || ''; |
|
|
|
|
|
this.em = this.config.em; |
|
|
const coll = this.collection; |
|
|
const coll = this.collection; |
|
|
this.listenTo(coll, 'reset', this.renderAssets); |
|
|
this.listenTo(coll, 'reset', this.renderAssets); |
|
|
this.listenTo(coll, 'add', this.addToAsset); |
|
|
this.listenTo(coll, 'add', this.addToAsset); |
|
|
|