]> _ Git - fluidbook-html5.git/commitdiff
wait #3827 @1.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 30 Jul 2020 10:06:52 +0000 (12:06 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 30 Jul 2020 10:06:52 +0000 (12:06 +0200)
js/libs/fluidbook/fluidbook.articles.js
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.menu.js
style/articles.less

index 45a28c7c5a4ceca001515b1f589812a124af0ae5..d907675e577784ae8dbd78ac931ef8de340679c3 100644 (file)
@@ -42,11 +42,17 @@ FluidbookArticles.prototype = {
 
         var footer = '<div class="footer fixed"><a href="#/article/' + article.prev + '" class="article-prev">' + getSpriteIcon('interface-previous-simple') + ' ' + this.fluidbook.l10n.__('previous article') + '</a><a href="#/article/' + article.next + '" class="article-next">' + this.fluidbook.l10n.__('next article') + ' ' + getSpriteIcon('interface-next-simple') + '</a></div>';
         var view = '<div class="content">' + article.contents + '</div>' + footer;
-        this.fluidbook.menu.viewWrap(this.fluidbook.menu.closeButton() + view, 'article');
+        this.fluidbook.menu.viewWrap(this.fluidbook.menu.closeButton() + view, 'article', '', '', true);
+
+        this.fluidbook.silentChangePage(article.page, true);
 
-        this.fluidbook.silentChangePage(article.page);
-        this.resize();
         callback();
+        var $this = this;
+
+        setTimeout(function () {
+            $this.resize();
+        }, 10)
+
     },
 
     findArticleByURL: function (url) {
@@ -73,6 +79,10 @@ FluidbookArticles.prototype = {
             var w = $(this).width();
             var aw = $(this).find('.actions').outerWidth();
             $(this).find('h3').eq(0).css('width', w - aw);
+            var $this = this;
+            setTimeout(function () {
+                $($this).closest('.mview').addClass('visible');
+            }, 10);
         });
     },
 }
\ No newline at end of file
index 481484f9fa7ae5204532f2027d8e92531471b103..02adc0cb923ee1686facf1621ab74e92ebffe572 100644 (file)
@@ -453,10 +453,12 @@ Fluidbook.prototype = {
         return;
     },
 
-    silentChangePage: function (page) {
+    silentChangePage: function (page, transition) {
         if (page !== this.currentPage) {
-            this.currentPage = page;
-            this.pagetransitions.pageTransition(this.currentPage);
+            if (transition !== true) {
+                this.currentPage = page;
+            }
+            this.pagetransitions.pageTransition(page);
         }
     },
 
index c1ba684a92ba07fe304b0a099ef139d72f1ffc0a..e16c355e55af3d90d4d39545efdae66074736574 100644 (file)
@@ -303,7 +303,7 @@ FluidbookLinks.prototype = {
     },
 
     animateLinks: function () {
-        if (this.fluidbook.settings.linkBlinkTime == 0 || this.fluidbook.settings.linkBlinkRepetition == 0 || !this.fluidbook.settings.mobileLinksRevealAnim) {
+        if (this.fluidbook.settings.linkBlinkTime == 0 || this.fluidbook.settings.linkBlinkRepetition == 0 || !this.fluidbook.settings.mobileLinksRevealAnim || this.fluidbook.menu.viewMode()) {
             return;
         }
         var $this = this;
index 6f22206f580367a79a0b86e178b6e0dbecada1ee..989789453f3c8a9101e9e754687fb62a8192d98f 100644 (file)
@@ -157,7 +157,7 @@ FluidbookMenu.prototype = {
         }, 420);
     },
 
-    viewWrap: function (content, menu, attributes, cls) {
+    viewWrap: function (content, menu, attributes, cls,replace) {
         if (attributes === undefined) {
             attributes = '';
         }
@@ -165,7 +165,11 @@ FluidbookMenu.prototype = {
             cls = '';
         }
         var res = '<div class="mview ' + cls + '" data-menu="' + menu + '" role="dialog" aria-labelledby="mview-dialog-title"' + attributes + '>' + content + '</div>';
-        $("#view").append(res);
+        if(replace===true){
+            $("#view").html(res);
+        }else {
+            $("#view").append(res);
+        }
     },
 
     getCaption: function (caption, close, cls) {
index 71c52717868aa5cf02574c5c3ae76c8f4e16f8e6..62e7c17418ce1c0fa37252ea0b428b2fb9c56e9c 100644 (file)
@@ -6,6 +6,15 @@
   padding: 0;
 }
 
+.mview[data-menu="article"] {
+  transition: opacity 250ms;
+  opacity: 0 !important;
+
+  &.visible {
+    opacity: 1 !important;
+  }
+}
+
 article {
   position: relative;
   font-family: @articles-font;
@@ -51,7 +60,7 @@ article {
     margin: 20px 0;
     font-weight: 300;
 
-    &.inter{
+    &.inter {
       font-size: 18px;
       text-transform: none;
       font-weight: 600;