|
|
|
@ -7,7 +7,9 @@ module.exports = ComponentView.extend({ |
|
|
|
events: { |
|
|
|
dblclick: 'onActive', |
|
|
|
click: 'initResize', |
|
|
|
error: 'onError' |
|
|
|
error: 'onError', |
|
|
|
dragstart: 'noDrag', |
|
|
|
mousedown: 'noDrag' |
|
|
|
}, |
|
|
|
|
|
|
|
initialize(o) { |
|
|
|
@ -84,14 +86,17 @@ module.exports = ComponentView.extend({ |
|
|
|
if (fallback) this.el.src = fallback; |
|
|
|
}, |
|
|
|
|
|
|
|
noDrag(ev) { |
|
|
|
ev.preventDefault(); |
|
|
|
return false; |
|
|
|
}, |
|
|
|
|
|
|
|
render() { |
|
|
|
this.renderAttributes(); |
|
|
|
this.updateSrc(); |
|
|
|
const { $el, model } = this; |
|
|
|
const cls = $el.attr('class') || ''; |
|
|
|
!model.get('src') && $el.attr('class', `${cls} ${this.classEmpty}`.trim()); |
|
|
|
// Avoid strange behaviours with drag and drop
|
|
|
|
$el.attr('onmousedown', 'return false'); |
|
|
|
this.postRender(); |
|
|
|
|
|
|
|
return this; |
|
|
|
|