Fixed highlight problems
This commit is contained in:
parent
ed40ffc43f
commit
e72836e0f7
6
dist/iwmlib.js
vendored
6
dist/iwmlib.js
vendored
@ -10483,12 +10483,6 @@
|
||||
svgGroup.insertBefore(maskImage, element); // image.nextSibling)
|
||||
TweenLite.set(maskImage, { scale: 1 });
|
||||
maskImage.style.mask = 'url(#' + maskId + ')';
|
||||
|
||||
let rect = document.createElementNS(svg, 'rect');
|
||||
rect.setAttribute('width', width);
|
||||
rect.setAttribute('height', height);
|
||||
rect.classList.add('debugRect');
|
||||
svgGroup.appendChild(rect);
|
||||
}
|
||||
|
||||
svgGroup.appendChild(maskImage);
|
||||
|
@ -1,5 +1,4 @@
|
||||
/* eslint-disable no-console */
|
||||
/* global TweenLite */
|
||||
|
||||
let _HighlightEnabled = true
|
||||
let _CircleIds = 0
|
||||
@ -218,14 +217,14 @@ export default class Highlight extends Object {
|
||||
return
|
||||
}
|
||||
let image = svgRoot.querySelector('image')
|
||||
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
let [mask, maskImage] = Highlight._getSVGMask(target, {
|
||||
svgRoot,
|
||||
image
|
||||
})
|
||||
let center = Highlight._calculateCenterRelativeTo(target, image)
|
||||
console.log("_calculateCenterRelativeTo", center)
|
||||
console.log('_calculateCenterRelativeTo', center)
|
||||
TweenLite.set(maskImage, {
|
||||
transformOrigin: `${center.x} ${center.y}`
|
||||
})
|
||||
@ -241,7 +240,7 @@ export default class Highlight extends Object {
|
||||
}
|
||||
|
||||
static toggleHighlight(node) {
|
||||
console.log("toggleHighlight", Highlight._isExpanded(node))
|
||||
console.log('toggleHighlight', Highlight._isExpanded(node))
|
||||
if (Highlight._isExpanded(node)) {
|
||||
Highlight.closeHighlight(node)
|
||||
} else {
|
||||
@ -345,12 +344,6 @@ export default class Highlight extends Object {
|
||||
svgGroup.insertBefore(maskImage, element) // image.nextSibling)
|
||||
TweenLite.set(maskImage, { scale: 1 })
|
||||
maskImage.style.mask = 'url(#' + maskId + ')'
|
||||
|
||||
let rect = document.createElementNS(svg, 'rect')
|
||||
rect.setAttribute('width', width)
|
||||
rect.setAttribute('height', height)
|
||||
rect.classList.add('debugRect')
|
||||
svgGroup.appendChild(rect)
|
||||
}
|
||||
|
||||
svgGroup.appendChild(maskImage)
|
||||
@ -374,18 +367,8 @@ export default class Highlight extends Object {
|
||||
return target.classList.contains(Highlight.expandedClass)
|
||||
}
|
||||
|
||||
static _setExpanded(target) {
|
||||
target.classList.add(Highlight.expandedClass)
|
||||
}
|
||||
|
||||
static _notExpanded(target) {
|
||||
target.classList.remove(Highlight.expandedClass)
|
||||
}
|
||||
|
||||
static closeHighlight(target, { animation = 0.5 } = {}) {
|
||||
|
||||
Highlight._notExpanded(target)
|
||||
|
||||
target.classList.remove(Highlight.expandedClass)
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
let [mask, maskImage] = Highlight._getSVGMask(target)
|
||||
console.log('Close Highlight', maskImage)
|
||||
|
Loading…
Reference in New Issue
Block a user