]> _ Git - fluidbook-toolbox.git/commitdiff
wip #5639 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 12 Dec 2022 15:39:56 +0000 (16:39 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 12 Dec 2022 15:39:56 +0000 (16:39 +0100)
resources/linkeditor/js/linkeditor.js
resources/linkeditor/js/linkeditor.links.js
resources/linkeditor/js/linkeditor.utils.js
resources/linkeditor/style/style.sass

index 6c387cf5d13d3af4ec0aa378a41d5042323b61ba..7e1e3b13a8034c43f04e1272a77517484c7da6e1 100644 (file)
@@ -50,7 +50,9 @@ $.ajaxSetup({
 });
 
 function LinkEditor() {
+    this.mobileFirst = FLUIDBOOK_DATA.settings.mobileNavigationType === 'mobilefirst';
     this.single = ['mobilefirst', 'portrait'].indexOf(FLUIDBOOK_DATA.settings.mobileNavigationType) >= 0;
+
     this.pw = FLUIDBOOK_DATA.settings.width;
     this.ph = FLUIDBOOK_DATA.settings.height;
     this.fw = this.pw * (this.single ? 1 : 2);
@@ -326,7 +328,7 @@ LinkEditor.prototype = {
         window.location.hash = '#' + this.currentPage;
         this.clearLinksAndRulers();
         this.loader.loadPage(this.currentPage, 'left');
-        if (!this.loader.single) {
+        if (!this.single) {
             this.loader.loadPage(this.currentPage + 1, 'right');
         }
         $("#linkeditor-page-field input").val(this.currentPage);
index aa7a81100c56462cfe1d390d54b8504a319d8bee..0a64a14d5f0d5c0c784dbde8c4dcfd3e32e72c75 100644 (file)
@@ -419,6 +419,10 @@ LinkeditorLinks.prototype = {
     loadLinks: function (page, side) {
         let $this = this;
         $.each(LINKS, function (uid, link) {
+            if ($this.linkeditor.single && page % 2 === 1 && link.page % 2 === 0 && link.left > $this.linkeditor.pw) {
+                link.page++;
+                link.left -= $this.linkeditor.pw;
+            }
             if (link.page != page) {
                 return;
             }
index 3c7023a2eee912042421b2360e42529789de40bc..25454c37198c45d5e673603edea26baf0e48f6ec 100644 (file)
@@ -13,12 +13,12 @@ LinkeditorUtils.prototype = {
         if (page % 2 === 1 && !this.linkeditor.single) {
             page--;
         }
-        return Math.max(0, Math.min(page, FLUIDBOOK_DATA.settings.pages));
+        return Math.max(this.linkeditor.single ? 1 : 0, Math.min(page, FLUIDBOOK_DATA.settings.pages));
     },
 
     splitPages: function (str) {
         let res = [];
-        if(str===undefined || str===null){
+        if (str === undefined || str === null) {
             return res;
         }
         str = str.toString();
index ecc074e61fed0f5be0eff803b34ab43bc990732f..b53c01da493e82232e3feddc53099ad9021725b1 100644 (file)
@@ -6,6 +6,7 @@
     margin: 0
     padding: 0
     box-sizing: border-box
+
     &:focus
         outline: 0
 
@@ -125,9 +126,9 @@ body, #linkeditor, html
                                 &.texts
                                     z-index: 2
 
-                        &#linkeditor-page-right
-                            .simple &
-                                display: none
+    &.single
+        #linkeditor-page-right
+            display: none
 
 #linkeditor-preload
     display: none