Refactor icon in lightbox to fix IE bug

stable
Xavier Julián 2016-04-20 12:30:47 +02:00
parent 5026ecbf33
commit a44dcf4613
2 changed files with 15 additions and 8 deletions

View File

@ -173,14 +173,17 @@ class ConfirmService extends taiga.Service
if icon.type == "img"
detailImage = $('<img>').addClass('lb-icon').attr('src', icon.name)
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.setAttributeNS('http://www.w3.org/1999/xlink','href', '#' + icon.name)
detailImage = document.createElementNS("http://www.w3.org/2000/svg", "svg")
taiga.addClass(detailImage, "icon")
taiga.addClass(detailImage, "lb-icon")
taiga.addClass(detailImage, icon.name)
detailImage.appendChild(useSVG)
detailImage.appendChild(svgContainer).appendChild(useSVG)
if detailImage
el.find('section').prepend(detailImage)

View File

@ -55,10 +55,14 @@
transition: opacity .3s ease;
}
.lb-icon {
@include svg-size(6rem);
display: block;
fill: $whitish;
margin: 1rem auto;
display: flex;
justify-content: center;
svg {
@include svg-size(6rem);
display: block;
fill: $whitish;
}
}
.title {
text-align: center;