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)
|
svgGroup.insertBefore(maskImage, element); // image.nextSibling)
|
||||||
TweenLite.set(maskImage, { scale: 1 });
|
TweenLite.set(maskImage, { scale: 1 });
|
||||||
maskImage.style.mask = 'url(#' + maskId + ')';
|
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);
|
svgGroup.appendChild(maskImage);
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
/* global TweenLite */
|
|
||||||
|
|
||||||
let _HighlightEnabled = true
|
let _HighlightEnabled = true
|
||||||
let _CircleIds = 0
|
let _CircleIds = 0
|
||||||
@ -225,7 +224,7 @@ export default class Highlight extends Object {
|
|||||||
image
|
image
|
||||||
})
|
})
|
||||||
let center = Highlight._calculateCenterRelativeTo(target, image)
|
let center = Highlight._calculateCenterRelativeTo(target, image)
|
||||||
console.log("_calculateCenterRelativeTo", center)
|
console.log('_calculateCenterRelativeTo', center)
|
||||||
TweenLite.set(maskImage, {
|
TweenLite.set(maskImage, {
|
||||||
transformOrigin: `${center.x} ${center.y}`
|
transformOrigin: `${center.x} ${center.y}`
|
||||||
})
|
})
|
||||||
@ -241,7 +240,7 @@ export default class Highlight extends Object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static toggleHighlight(node) {
|
static toggleHighlight(node) {
|
||||||
console.log("toggleHighlight", Highlight._isExpanded(node))
|
console.log('toggleHighlight', Highlight._isExpanded(node))
|
||||||
if (Highlight._isExpanded(node)) {
|
if (Highlight._isExpanded(node)) {
|
||||||
Highlight.closeHighlight(node)
|
Highlight.closeHighlight(node)
|
||||||
} else {
|
} else {
|
||||||
@ -345,12 +344,6 @@ export default class Highlight extends Object {
|
|||||||
svgGroup.insertBefore(maskImage, element) // image.nextSibling)
|
svgGroup.insertBefore(maskImage, element) // image.nextSibling)
|
||||||
TweenLite.set(maskImage, { scale: 1 })
|
TweenLite.set(maskImage, { scale: 1 })
|
||||||
maskImage.style.mask = 'url(#' + maskId + ')'
|
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)
|
svgGroup.appendChild(maskImage)
|
||||||
@ -374,18 +367,8 @@ export default class Highlight extends Object {
|
|||||||
return target.classList.contains(Highlight.expandedClass)
|
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 } = {}) {
|
static closeHighlight(target, { animation = 0.5 } = {}) {
|
||||||
|
target.classList.remove(Highlight.expandedClass)
|
||||||
Highlight._notExpanded(target)
|
|
||||||
|
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
let [mask, maskImage] = Highlight._getSVGMask(target)
|
let [mask, maskImage] = Highlight._getSVGMask(target)
|
||||||
console.log('Close Highlight', maskImage)
|
console.log('Close Highlight', maskImage)
|
||||||
|
Loading…
Reference in New Issue
Block a user