@idraw/board
Advanced tools
Comparing version 0.2.0-alpha.9 to 0.2.0-alpha.10
@@ -40,3 +40,3 @@ 'use strict'; | ||
} | ||
function throttle$2(fn, timeout) { | ||
function throttle$1(fn, timeout) { | ||
var timer = -1; | ||
@@ -264,3 +264,3 @@ return function () { | ||
compose: compose, | ||
throttle: throttle$2, | ||
throttle: throttle$1, | ||
}, | ||
@@ -364,3 +364,2 @@ loader: { | ||
var throttle$1 = index.time.throttle; | ||
var ScreenWatcher = (function () { | ||
@@ -397,6 +396,17 @@ function ScreenWatcher(canvas) { | ||
canvas.addEventListener('mouseleave', this._listenCanvasMoveLeave.bind(this), true); | ||
if (window.self !== window.parent) { | ||
if (window.self.origin === window.parent.self.origin) { | ||
window.parent.window.addEventListener('mousemove', throttle$1(this._listSameOriginParentWindow.bind(this), 16), false); | ||
this._initParentEvent(); | ||
}; | ||
ScreenWatcher.prototype._initParentEvent = function () { | ||
var target = window; | ||
var targetOrigin = target.origin; | ||
while (target.self !== target.top) { | ||
if (target.self !== target.parent) { | ||
if (target.origin === targetOrigin) { | ||
window.parent.window.addEventListener('mousemove', this._listSameOriginParentWindow.bind(this), false); | ||
} | ||
} | ||
target = target.parent; | ||
if (!target) { | ||
break; | ||
} | ||
} | ||
@@ -403,0 +413,0 @@ }; |
@@ -38,3 +38,3 @@ var __assign = function() { | ||
} | ||
function throttle$2(fn, timeout) { | ||
function throttle$1(fn, timeout) { | ||
var timer = -1; | ||
@@ -262,3 +262,3 @@ return function () { | ||
compose: compose, | ||
throttle: throttle$2, | ||
throttle: throttle$1, | ||
}, | ||
@@ -362,3 +362,2 @@ loader: { | ||
var throttle$1 = index.time.throttle; | ||
var ScreenWatcher = (function () { | ||
@@ -395,6 +394,17 @@ function ScreenWatcher(canvas) { | ||
canvas.addEventListener('mouseleave', this._listenCanvasMoveLeave.bind(this), true); | ||
if (window.self !== window.parent) { | ||
if (window.self.origin === window.parent.self.origin) { | ||
window.parent.window.addEventListener('mousemove', throttle$1(this._listSameOriginParentWindow.bind(this), 16), false); | ||
this._initParentEvent(); | ||
}; | ||
ScreenWatcher.prototype._initParentEvent = function () { | ||
var target = window; | ||
var targetOrigin = target.origin; | ||
while (target.self !== target.top) { | ||
if (target.self !== target.parent) { | ||
if (target.origin === targetOrigin) { | ||
window.parent.window.addEventListener('mousemove', this._listSameOriginParentWindow.bind(this), false); | ||
} | ||
} | ||
target = target.parent; | ||
if (!target) { | ||
break; | ||
} | ||
} | ||
@@ -401,0 +411,0 @@ }; |
@@ -41,3 +41,3 @@ var iDrawBoard = (function () { | ||
} | ||
function throttle$2(fn, timeout) { | ||
function throttle$1(fn, timeout) { | ||
var timer = -1; | ||
@@ -265,3 +265,3 @@ return function () { | ||
compose: compose, | ||
throttle: throttle$2, | ||
throttle: throttle$1, | ||
}, | ||
@@ -365,3 +365,2 @@ loader: { | ||
var throttle$1 = index.time.throttle; | ||
var ScreenWatcher = (function () { | ||
@@ -398,6 +397,17 @@ function ScreenWatcher(canvas) { | ||
canvas.addEventListener('mouseleave', this._listenCanvasMoveLeave.bind(this), true); | ||
if (window.self !== window.parent) { | ||
if (window.self.origin === window.parent.self.origin) { | ||
window.parent.window.addEventListener('mousemove', throttle$1(this._listSameOriginParentWindow.bind(this), 16), false); | ||
this._initParentEvent(); | ||
}; | ||
ScreenWatcher.prototype._initParentEvent = function () { | ||
var target = window; | ||
var targetOrigin = target.origin; | ||
while (target.self !== target.top) { | ||
if (target.self !== target.parent) { | ||
if (target.origin === targetOrigin) { | ||
window.parent.window.addEventListener('mousemove', this._listSameOriginParentWindow.bind(this), false); | ||
} | ||
} | ||
target = target.parent; | ||
if (!target) { | ||
break; | ||
} | ||
} | ||
@@ -404,0 +414,0 @@ }; |
{ | ||
"name": "@idraw/board", | ||
"version": "0.2.0-alpha.9", | ||
"version": "0.2.0-alpha.10", | ||
"description": "", | ||
@@ -26,6 +26,6 @@ "main": "dist/index.cjs.js", | ||
"devDependencies": { | ||
"@idraw/types": "^0.2.0-alpha.9" | ||
"@idraw/types": "^0.2.0-alpha.10" | ||
}, | ||
"dependencies": { | ||
"@idraw/util": "^0.2.0-alpha.9" | ||
"@idraw/util": "^0.2.0-alpha.10" | ||
}, | ||
@@ -35,3 +35,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "5a6f75f6e1ad11b635e1e165c4f826ead00125b3" | ||
"gitHead": "0e4ae3a8ee85cc715f4252f45e2035b0ab902adf" | ||
} |
157465
3904
Updated@idraw/util@^0.2.0-alpha.10