]> _ Git - fluidbook-html5.git/commitdiff
fix #3698
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Jun 2020 09:38:46 +0000 (11:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 30 Jun 2020 09:38:46 +0000 (11:38 +0200)
js/libs/fluidbook/fluidbook.articles.js
style/articles.less

index af8397c3385c03c4f7caa9082d90f773523a2709..3563e78fb9d65318b92997ceb2b2ec9258958b35 100644 (file)
@@ -15,7 +15,7 @@ FluidbookArticles.prototype = {
             $this.resize();
         });
 
-        $(document).on('click', '.mview[data-menu="article"] .print', function () {
+        $(document).on('click touchend', '.mview[data-menu="article"] .articlesPrint', function () {
             var a = $(this).closest('article').attr('data-id');
             var print_window = window.open('', 'print_article', 'height=400,width=600');
             print_window.document.write($this.fluidbook.settings.articlesList[a].print);
@@ -26,6 +26,12 @@ FluidbookArticles.prototype = {
             }, 1000);
             return false;
         });
+
+        $(document).on('click touchend', '.mview[data-menu="article"] .articlesShare', function () {
+            $(".mview").remove();
+            $this.fluidbook.menu.openView('share', 'article:'+$(this).attr('data-id'), 'article');
+            return false;
+        });
     },
 
     openArticle: function (url, callback) {
@@ -39,6 +45,7 @@ FluidbookArticles.prototype = {
         $("#view").html('<div class="mview" data-menu="article">' + this.fluidbook.menu.closeButton() + view + '</div>');
 
         this.fluidbook.silentChangePage(article.page);
+        this.resize();
         callback();
     },
 
@@ -58,6 +65,10 @@ FluidbookArticles.prototype = {
     },
 
     resize: function () {
-
+        $(".mview article").each(function () {
+            var w = $(this).width();
+            var aw = $(this).find('.actions').outerWidth();
+            $(this).find('h3').eq(0).css('width', w - aw);
+        });
     },
 }
\ No newline at end of file
index 81e17230e518ca60fc8c42b061f4414e4e4466bc..b585678be1a8e853c21c5b63fabad24d105f52b8 100644 (file)
@@ -16,25 +16,32 @@ article {
   font-weight: 300;
   text-align: left;
 
-  .print {
+  .actions {
     position: absolute;
     top: 55px;
     right: 45px;
     color: @articles-title-color;
 
-    svg {
-      fill:currentColor;
+    a {
       width: 20px;
+      height: 20px;
+      margin-left: 10px;
+      display: inline-block;
+
+      svg {
+        fill: currentColor;
+        width: 20px;
+      }
     }
   }
 
+
   h3 {
     color: #fff;
     font-size: 14px;
     padding: 5px 10px;
     font-weight: 300;
     text-transform: uppercase;
-    width: ~"calc(100% - 30px)";
   }
 
   h2 {