mirror of https://github.com/artf/grapesjs.git
1 changed files with 6 additions and 6 deletions
@ -1,23 +1,23 @@ |
|||||
import ComponentView from './ComponentView'; |
import ComponentView from './ComponentView'; |
||||
import { createEl, find, attrUp } from 'utils/dom'; |
import { createEl, find, attrUp } from '../../utils/dom'; |
||||
|
|
||||
export default class ComponentFrameView extends ComponentView { |
export default class ComponentFrameView extends ComponentView { |
||||
tagName() { |
tagName() { |
||||
return 'div'; |
return 'div'; |
||||
} |
} |
||||
|
|
||||
initialize(...args) { |
initialize(props: any) { |
||||
ComponentView.prototype.initialize.apply(this, args); |
super.initialize(props); |
||||
this.listenTo(this.model, 'change:attributes:src', this.updateSrc); |
this.listenTo(this.model, 'change:attributes:src', this.updateSrc); |
||||
} |
} |
||||
|
|
||||
updateSrc() { |
updateSrc() { |
||||
const frame = find(this.el, 'iframe')[0]; |
const frame = find(this.el, 'iframe')[0] as HTMLElement; |
||||
frame && attrUp(frame, { src: this.__getSrc() }); |
frame && attrUp(frame, { src: this.__getSrc() }); |
||||
} |
} |
||||
|
|
||||
render(...args) { |
render() { |
||||
ComponentView.prototype.render.apply(this, args); |
super.render(); |
||||
const frame = createEl('iframe', { |
const frame = createEl('iframe', { |
||||
class: `${this.ppfx}no-pointer`, |
class: `${this.ppfx}no-pointer`, |
||||
style: 'width: 100%; height: 100%; border: none', |
style: 'width: 100%; height: 100%; border: none', |
||||
Loading…
Reference in new issue