},
animation: function() {
- let el = $("[data-action^='links.']")
- el.addClass("active")
- if(el.hasClass("active")) {
- this.setPreview()
- this.setAnim()
- } else {
- this.clearPreview()
- el.removeClass("active")
- }
+ $("[data-action='links.preview']").addClass("active")
+ this.setPreview()
+ this.setAnim()
},
loadFontSize: function() {
'z-index': 99
})
} else if (linkData.type === '15' || /\.(jpg|png|svg|webp|avif)$/.exec(linkData.image)) {
- let imgUrl = linkData.type === '15' ? ASSETS['uid_' + linkData.uid]['url'] : "/fluidbook-publication/" + FLUIDBOOK_DATA.id + "/edit/links/assets/" + linkData.image
+ let imgUrl = "/fluidbook-publication/" + FLUIDBOOK_DATA.id + "/edit/links/assets/" + linkData.image
+ if(ASSETS['uid_' + linkData.uid]['url'] !== undefined && linkData.type === '15') {
+ imgUrl = ASSETS['uid_' + linkData.uid]['url']
+ }
imgUrl = imgUrl + (imgUrl.includes('.svg') ? "#svgView(preserveAspectRatio(none))" : '')
let img = "<img src='" + imgUrl + "' />"
$("[data-id-preview=" + linkData.uid + "]").html(img)
} else if (linkData.type === '35') {
var hash = 'fb_' + window.MD5(linkData.image).toString().substring(0, 10)
this.setFontSize(linkData)
- $("[data-id-preview=" + linkData.uid + "]").text(linkData.to).css({
+ $("[data-id-preview=" + linkData.uid + "]").addClass("link-text").text(linkData.to).css({
'height': 'auto',
'width': 'max-content',
'font-family': hash,
for(let link in links) {
if(!isActive) {
- console.log('ok 2')
this.updatePreview(links[link], zooming)
}
}
},
- setAnim: function() {
- const links = this.getLinksOfPage(this.linkeditor.currentPage)
+ setAnim: function(all = true) {
+ const links = all ? this.getLinksOfPage(this.linkeditor.currentPage) : [this.getLinksOfPage(this.linkeditor.currentPage)[this.getCurrentSelection().attr('fb-uid')]]
for(let link in links) {
let animationText = $("[fb-uid=" + links[link].uid + "]").attr("fb-image_rollover")
let animations = this.resolveAnimation(animationText)
+ let previewDiv = $("[data-id-preview=" + links[link].uid + "]")
+ let el = previewDiv.get(0)
+
+ if(links[link].type === '15' || /\.(jpg|png|svg|webp|avif)$/.exec(links[link].image)) {
+ el = previewDiv.children().get(0)
+ }
- this.linkeditor.linksAnimations.executeAnimations($("[data-id-preview=" + links[link].uid + "]").children().get(0), animations)
+ this.linkeditor.linksAnimations.executeAnimations(el, animations)
}
},
.select2-container--bootstrap .select2-results > .select2-results__options
max-height: 350px !important
+
+[data-name='image_rollover'] label
+ display: flex !important
+ align-items: end
+ justify-content: space-between
+
#linkeditor-start-animation
- display: block
+ display: flex
+ width: 26px
+ height: 26px
+ background: transparent
+ padding: 4px 4px
+ border: 0
+ &:hover
+ background-color: #000
+ svg
+ width: 100%
+ fill: transparent