|
|
|
@ -1,3 +1,5 @@ |
|
|
|
import {on, off} from 'utils/mixins' |
|
|
|
|
|
|
|
const ToolbarView = require('dom_components/view/ToolbarView'); |
|
|
|
const Toolbar = require('dom_components/model/Toolbar'); |
|
|
|
const key = require('keymaster'); |
|
|
|
@ -67,16 +69,6 @@ module.exports = { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Returns canavs body el |
|
|
|
*/ |
|
|
|
getCanvasBodyEl() { |
|
|
|
if(!this.$bodyEl) { |
|
|
|
this.$bodyEl = $(this.getCanvasBody()); |
|
|
|
} |
|
|
|
return this.$bodyEl; |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* Start select component event |
|
|
|
* @private |
|
|
|
@ -98,16 +90,15 @@ module.exports = { |
|
|
|
* @private |
|
|
|
* */ |
|
|
|
toggleSelectComponent(enable) { |
|
|
|
var el = '*'; |
|
|
|
var method = enable ? 'on' : 'off'; |
|
|
|
this.getCanvasBodyEl() |
|
|
|
[method]('mouseover', el, this.onHover) |
|
|
|
[method]('mouseout', el, this.onOut) |
|
|
|
[method]('click', el, this.onClick); |
|
|
|
|
|
|
|
var cw = this.getContentWindow(); |
|
|
|
cw[method]('scroll', this.onFrameScroll); |
|
|
|
cw[method]('keydown', this.onKeyPress); |
|
|
|
const method = enable ? 'on' : 'off'; |
|
|
|
const methods = {on, off}; |
|
|
|
const body = this.getCanvasBody(); |
|
|
|
const win = this.getContentWindow(); |
|
|
|
methods[method](body, 'mouseover', this.onHover); |
|
|
|
methods[method](body, 'mouseout', this.onOut); |
|
|
|
methods[method](body, 'click', this.onClick); |
|
|
|
methods[method](win, 'scroll', this.onFrameScroll); |
|
|
|
methods[method](win, 'keydown', this.onKeyPress); |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -556,9 +547,7 @@ module.exports = { |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
getContentWindow() { |
|
|
|
if(!this.contWindow) |
|
|
|
this.contWindow = $(this.frameEl.contentWindow); |
|
|
|
return this.contWindow; |
|
|
|
return this.frameEl.contentWindow; |
|
|
|
}, |
|
|
|
|
|
|
|
run(editor) { |
|
|
|
|