}
},
- setPreview: function(isZooming = false) {
+ setPreview: function(isZooming = false, reset = false) {
const links = this.linkeditor.links.getLinksOfPage(this.linkeditor.currentPage)
for (let link in links) {
- this.updatePreview(links[link],isZooming)
+ this.updatePreview(links[link],isZooming,reset)
}
},
- updatePreview: function(link, isZooming = false) {
+ updatePreview: function(link, isZooming = false, reset = false) {
let $this = this
this.linkData = link
let l = this.linkeditor.links.getLinkById(link.uid)
l.html("<div class='bg-preview'></div><div data-id-preview-wrap='" + link.uid + "'><div data-id-preview='" + link.uid + "'></div></div>")
}
- $("[data-id-preview=" + this.linkData.uid + "]").css({
- height: '100%',
- width: '100%'
- })
-
- $this.previewByType(link.type, isZooming)
+ $this.previewByType(link.type, isZooming, reset)
},
- previewByType: function (type, isZooming = false) {
+ previewByType: function (type, isZooming = false, reset = false) {
const $this = this
if (type === '14') {
this.previewColor($this)
} else if (type === '35') {
this.previewText($this)
} else if (type === '39') {
- this.previewLayer($this,isZooming)
+ this.previewLayer($this,isZooming,reset)
}
if (type === '10') {
this.linkeditor.links.updateFontSize($this.linkData)
},
- previewLayer: function($this,isZooming) {
+ previewLayer: function($this,isZooming,reset) {
let $link = $("[fb-uid="+$this.linkData.uid+"]")
let animationText = $link.attr("fb-image_rollover")
let animations = $this.linkeditor.links.resolveAnimation(animationText)
let animZoom = animations.filter((v) => v.type === "zoomout" || v.type === "zoomin")
let previewDiv = $("[data-id-preview=" + $this.linkData.uid + "]")
+ const z = this.linkeditor.zoom.normalizeZoom(this.linkeditor.zoom.getZoom())
+ if(z) {
+ this.linkeditor.zoom.setZoom(z)
+ }
+
+ /**
+ *
+ * (Voir linkeditor.resize.js resizePages())
+ *
+ * Application des styles pour #linkeditor-fluidbook-copy
+ */
+ let width = $("#linkeditor-fluidbook").css("width")
+ let height = $("#linkeditor-fluidbook").css("height")
+ let left_ = $("#linkeditor-fluidbook").css("left")
+ let top_ = $("#linkeditor-fluidbook").css("top")
+ let transform = $("#linkeditor-fluidbook").css("transform")
+ $(".linkeditor-fluidbook-copy").css({'width':width,'height':height,'left':left_,'top':top_,'transform':transform})
+
+ /**
+ * Application des styles pour #linkeditor-page-right-copy
+ */
+ let left__ = $("#linkeditor-page-right").css("left")
+ $(".linkeditor-page-right-copy").css('left',left__)
+
+ /**
+ *
+ */
if(!isZooming) {
this.createPreviewLayerHTML(previewDiv,animZoom.length > 0)
- this.linkeditor.resize.resizePages()
if (animZoom.length > 0) {
$("[data-id-preview=" + $this.linkData.uid + "] .preview-wrapper").addClass("img")
})
}
-
//$("[data-id-preview=" + $this.linkData.uid + "] .preview-wrapper .linkeditor-page").remove()
} else {
if ($("[data-id-preview=" + $this.linkData.uid + "] img").length < 1) {
}
}
- this.linkeditor.resize.resizeCanvas()
+ if(reset) {
+ $this.linkeditor.rulers.updateRulers();
+ }
let linkeditorZoomRect = $("#linkeditor-zoom")[0].getBoundingClientRect()
- let left = $this.linkeditor.fluidbookToGlobal($this.linkData.left, 'left') - linkeditorZoomRect.left
- let top = $this.linkeditor.fluidbookToGlobal($this.linkData.top, 'top') - linkeditorZoomRect.top
+ let left = this.linkeditor.fluidbookToGlobal($this.linkData.left, 'left') - linkeditorZoomRect.left
+ let top = this.linkeditor.fluidbookToGlobal($this.linkData.top, 'top') - linkeditorZoomRect.top
+ //
previewDiv.find(".linkeditor-zoom-copy").css({
"left": -left - 1,
"top": -top - 1,
},
resize: function () {
-
let special = this.linkeditor.utils.isSpecialPage();
if (this.linkeditor.single || special) {
$("#linkeditor").addClass('single').removeClass('double');
if (!this.linkeditor.single && !special) {
fw *= 2;
}
- $("#linkeditor-page-right,.linkeditor-page-right-copy").css({left: this.linkeditor.pw});
- $("#linkeditor-fluidbook,.linkeditor-fluidbook-copy").css({width: fw, height: ph});
+ $("#linkeditor-page-right").css({left: this.linkeditor.pw});
+ $("#linkeditor-fluidbook").css({width: fw, height: ph});
},
left = (this.linkeditor.canvasRect.width - this.linkeditor.fw * this.linkeditor.fs) / 2;
top = 75;
}
- $("#linkeditor-fluidbook,.linkeditor-fluidbook-copy").css({left: left, top: top, transform: 'scale(' + this.linkeditor.fs + ')'});
+ $("#linkeditor-fluidbook").css({left: left, top: top, transform: 'scale(' + this.linkeditor.fs + ')'});
},
};
export default LinkeditorResize;