Refactor icon in lightbox to fix IE bug
parent
5026ecbf33
commit
a44dcf4613
|
@ -173,14 +173,17 @@ class ConfirmService extends taiga.Service
|
||||||
if icon.type == "img"
|
if icon.type == "img"
|
||||||
detailImage = $('<img>').addClass('lb-icon').attr('src', icon.name)
|
detailImage = $('<img>').addClass('lb-icon').attr('src', icon.name)
|
||||||
else if icon.type == "svg"
|
else if icon.type == "svg"
|
||||||
|
detailImage = document.createElement("div")
|
||||||
|
taiga.addClass(detailImage, "icon")
|
||||||
|
taiga.addClass(detailImage, icon.name)
|
||||||
|
taiga.addClass(detailImage, "lb-icon")
|
||||||
|
|
||||||
|
svgContainer = document.createElementNS("http://www.w3.org/2000/svg", "svg")
|
||||||
|
|
||||||
useSVG = document.createElementNS('http://www.w3.org/2000/svg', 'use')
|
useSVG = document.createElementNS('http://www.w3.org/2000/svg', 'use')
|
||||||
useSVG.setAttributeNS('http://www.w3.org/1999/xlink','href', '#' + icon.name)
|
useSVG.setAttributeNS('http://www.w3.org/1999/xlink','href', '#' + icon.name)
|
||||||
|
|
||||||
detailImage = document.createElementNS("http://www.w3.org/2000/svg", "svg")
|
detailImage.appendChild(svgContainer).appendChild(useSVG)
|
||||||
taiga.addClass(detailImage, "icon")
|
|
||||||
taiga.addClass(detailImage, "lb-icon")
|
|
||||||
taiga.addClass(detailImage, icon.name)
|
|
||||||
detailImage.appendChild(useSVG)
|
|
||||||
|
|
||||||
if detailImage
|
if detailImage
|
||||||
el.find('section').prepend(detailImage)
|
el.find('section').prepend(detailImage)
|
||||||
|
|
|
@ -55,10 +55,14 @@
|
||||||
transition: opacity .3s ease;
|
transition: opacity .3s ease;
|
||||||
}
|
}
|
||||||
.lb-icon {
|
.lb-icon {
|
||||||
@include svg-size(6rem);
|
|
||||||
display: block;
|
|
||||||
fill: $whitish;
|
|
||||||
margin: 1rem auto;
|
margin: 1rem auto;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
svg {
|
||||||
|
@include svg-size(6rem);
|
||||||
|
display: block;
|
||||||
|
fill: $whitish;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
Loading…
Reference in New Issue