Moved polyfill from utils to own file
This commit is contained in:
parent
34792f20d6
commit
2987b820a9
4
dist/iwmlib.3rdparty.js
vendored
4
dist/iwmlib.3rdparty.js
vendored
@ -83764,7 +83764,7 @@ if (typeof pixi_viewport !== 'undefined') { Object.assign(this.PIXI, pixi_viewpo
|
|||||||
window.convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
window.convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
||||||
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
||||||
}
|
}
|
||||||
})()
|
})();
|
||||||
|
|
||||||
;(function () {
|
;(function () {
|
||||||
var module = {
|
var module = {
|
||||||
@ -83989,7 +83989,7 @@ if (typeof pixi_viewport !== 'undefined') { Object.assign(this.PIXI, pixi_viewpo
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})(jQuery)
|
})(jQuery);
|
||||||
|
|
||||||
(function () {
|
(function () {
|
||||||
|
|
||||||
|
2
dist/iwmlib.3rdparty.min.js
vendored
2
dist/iwmlib.3rdparty.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/iwmlib.3rdparty.preload.js
vendored
2
dist/iwmlib.3rdparty.preload.js
vendored
@ -8189,4 +8189,4 @@ if (_gsScope._gsDefine) { _gsScope._gsQueue.pop()(); } //necessary in case Tween
|
|||||||
window.convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
window.convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
||||||
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
||||||
}
|
}
|
||||||
})()
|
})();
|
||||||
|
2
lib/3rdparty/convertPointFromPageToNode.js
vendored
2
lib/3rdparty/convertPointFromPageToNode.js
vendored
@ -80,4 +80,4 @@
|
|||||||
window.convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
window.convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
||||||
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
||||||
}
|
}
|
||||||
})()
|
})();
|
||||||
|
2
lib/3rdparty/jquery.hypher.js
vendored
2
lib/3rdparty/jquery.hypher.js
vendored
@ -221,4 +221,4 @@
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})(jQuery)
|
})(jQuery);
|
||||||
|
@ -597,8 +597,6 @@ export default class Card {
|
|||||||
// Prevents loading the link in the current tab.
|
// Prevents loading the link in the current tab.
|
||||||
if (event.type != 'Follow') {
|
if (event.type != 'Follow') {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
|
||||||
event.stopImmediatePropagation()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (editable && event.type == 'click') {
|
if (editable && event.type == 'click') {
|
||||||
|
86
lib/utils.js
86
lib/utils.js
@ -412,95 +412,21 @@ export class Points {
|
|||||||
|
|
||||||
static fromPageToNode(element, p) {
|
static fromPageToNode(element, p) {
|
||||||
// if (window.webkitConvertPointFromPageToNode) {
|
// if (window.webkitConvertPointFromPageToNode) {
|
||||||
// return window.webkitConvertPointFromPageToNode(element, new WebKitPoint(p.x, p.y))
|
// return window.webkitConvertPointFromPageToNode(element,
|
||||||
|
// new WebKitPoint(p.x, p.y))
|
||||||
// }
|
// }
|
||||||
return convertPointFromPageToNode(element, p.x, p.y)
|
return window.convertPointFromPageToNode(element, p.x, p.y)
|
||||||
}
|
}
|
||||||
|
|
||||||
static fromNodeToPage(element, p) {
|
static fromNodeToPage(element, p) {
|
||||||
// if (window.webkitConvertPointFromNodeToPage) {
|
// if (window.webkitConvertPointFromNodeToPage) {
|
||||||
// return window.webkitConvertPointFromNodeToPage(element, new WebKitPoint(p.x, p.y))
|
// return window.webkitConvertPointFromNodeToPage(element,
|
||||||
|
// new WebKitPoint(p.x, p.y))
|
||||||
// }
|
// }
|
||||||
return convertPointFromNodeToPage(element, p.x, p.y)
|
return window.convertPointFromNodeToPage(element, p.x, p.y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var I = typeof WebKitCSSMatrix == 'undefined' ? new DOMMatrix() : new WebKitCSSMatrix()
|
|
||||||
|
|
||||||
function Point(x, y, z) {
|
|
||||||
this.x = x
|
|
||||||
this.y = y
|
|
||||||
this.z = z
|
|
||||||
}
|
|
||||||
|
|
||||||
Point.prototype.transformBy = function (matrix) {
|
|
||||||
var tmp = matrix.multiply(I.translate(this.x, this.y, this.z))
|
|
||||||
return new Point(tmp.m41, tmp.m42, tmp.m43)
|
|
||||||
}
|
|
||||||
|
|
||||||
function createMatrix(transform) {
|
|
||||||
try {
|
|
||||||
return typeof WebKitCSSMatrix == 'undefined' ? new DOMMatrix(transform) : new WebKitCSSMatrix(transform)
|
|
||||||
} catch (e) {
|
|
||||||
console.warn(transform)
|
|
||||||
console.warn(e.toString())
|
|
||||||
return I
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function getTransformationMatrix(element) {
|
|
||||||
var transformationMatrix = I
|
|
||||||
var x = element
|
|
||||||
|
|
||||||
while (x != undefined && x !== x.ownerDocument.documentElement) {
|
|
||||||
var computedStyle = window.getComputedStyle(x, undefined)
|
|
||||||
var transform = computedStyle.transform || 'none'
|
|
||||||
var c = transform === 'none' ? I : createMatrix(transform)
|
|
||||||
transformationMatrix = c.multiply(transformationMatrix)
|
|
||||||
x = x.parentNode
|
|
||||||
}
|
|
||||||
|
|
||||||
var w = element.offsetWidth
|
|
||||||
var h = element.offsetHeight
|
|
||||||
var i = 4
|
|
||||||
var left = +Infinity
|
|
||||||
var top = +Infinity
|
|
||||||
while (--i >= 0) {
|
|
||||||
var p = new Point(i === 0 || i === 1 ? 0 : w, i === 0 || i === 3 ? 0 : h, 0).transformBy(
|
|
||||||
transformationMatrix
|
|
||||||
)
|
|
||||||
if (p.x < left) {
|
|
||||||
left = p.x
|
|
||||||
}
|
|
||||||
if (p.y < top) {
|
|
||||||
top = p.y
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var rect = element.getBoundingClientRect()
|
|
||||||
transformationMatrix = I.translate(
|
|
||||||
window.pageXOffset + rect.left - left,
|
|
||||||
window.pageYOffset + rect.top - top,
|
|
||||||
0
|
|
||||||
).multiply(transformationMatrix)
|
|
||||||
return transformationMatrix
|
|
||||||
}
|
|
||||||
|
|
||||||
var convertPointFromPageToNode = function (element, pageX, pageY) {
|
|
||||||
return new Point(pageX, pageY, 0).transformBy(getTransformationMatrix(element).inverse())
|
|
||||||
}
|
|
||||||
|
|
||||||
var convertPointFromNodeToPage = function (element, offsetX, offsetY) {
|
|
||||||
return new Point(offsetX, offsetY, 0).transformBy(getTransformationMatrix(element))
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A helper class for common set operations.
|
* A helper class for common set operations.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user