]> _ Git - fluidbook-html5.git/commitdiff
WIP #1501 @4.5
authorStephen Cameron <stephen@cubedesigners.com>
Mon, 26 Jun 2017 18:59:07 +0000 (20:59 +0200)
committerStephen Cameron <stephen@cubedesigners.com>
Mon, 26 Jun 2017 18:59:07 +0000 (20:59 +0200)
js/libs/fluidbook/fluidbook.nav.js
style/mmenu/mmenu.less

index 161705c9cdb6fe8b0a22d920e9ddfc48bc0f05a9..e52ba24d880d304c6cc49652de244729e5968031 100644 (file)
@@ -198,17 +198,55 @@ FluidbookNav.prototype = {
                         this.chaptersMenuHTML = this.makeChapterLists(this.fluidbook.datas.chapters);
                     }
                 }
+
+            // Sharing icons - this may contain many different icons
             } else if (icon == 'friend') {
-                if (this.fluidbook.datas.share) {
-                    this.addLink('nav-friend', '#/share', 'share', 'share');
-                    $("#share").click(function () {
-                        if ($this.fluidbook.datas.phonegap != 'android') {
-                            return true;
-                        }
-                        $this.fluidbook.intentShare();
-                        return false;
-                    });
+                // if (this.fluidbook.datas.share) {
+                //     this.addLink('nav-friend', '#/share', 'share', 'share');
+                //     $("#share").click(function () {
+                //         if ($this.fluidbook.datas.phonegap != 'android') {
+                //             return true;
+                //         }
+                //         $this.fluidbook.intentShare();
+                //         return false;
+                //     });
+                // }
+
+                var shareLinks = {},
+                    shareHTML = '';
+
+                if (this.fluidbook.datas.friend) {
+                    shareLinks['email'] = 'E-mail';
+                }
+                if (this.fluidbook.datas.facebook) {
+                    shareLinks['facebook'] = 'Facebook';
+                }
+                if (this.fluidbook.datas.twitter) {
+                    shareLinks['twitter'] = 'Twitter';
+                }
+                if (this.fluidbook.datas.googleplus) {
+                    shareLinks['googleplus'] = 'Google Plus';
+                }
+                if (this.fluidbook.datas.linkedin) {
+                    shareLinks['linkedin'] = 'LinkedIn';
                 }
+                if (this.fluidbook.datas.viadeo) {
+                    shareLinks['viadeo'] = 'Viadeo';
+                }
+
+                // Generate links
+                for (var shareType in shareLinks) {
+                    if (shareLinks.hasOwnProperty(shareType)) { // Ensure we don't get inherited properties
+                        shareHTML += '<a href="#" data-service="'+ shareType +'" class="share" title="'+ shareLinks[shareType] +'">';
+                        shareHTML += '<img src="data/images/share-'+ shareType +'.svg" />';
+                        shareHTML += '</a>';
+                    }
+                }
+
+                // Append to menu
+                this.menu.find('ul').append('<li id="shareLinks"><div class="mm-nopanel share-icons">'+ shareHTML +'</div></li>');
+
+
             } else if (icon == 'bookmark') {
                 if (this.fluidbook.datas.bookmark) {
                     this.addLink('interface-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks');
index 7b7226a5f4066144bdb7cadc65b3530796ea8f8c..f296fe69c42d34f1c5fe7179aebe2f2300b16661 100644 (file)
@@ -88,14 +88,17 @@ html.mm-opening .mm-menu.mm-opened[class*=mm-pagedim]~#mm-blocker {
 
 #menuOpener {
   position: absolute;
-  right: 10px;
-  top: 10px;
+  right: 20px;
+  top: 50%;
+  margin-top: -10px; // Half height of opening icon for centering
+  font-size: 16px;
+  line-height: 1;
   color: @icon-color;
 
   .svg-icon {
     width: 20px;
     vertical-align: middle;
-    margin-left: 15px;
+    margin-left: 18px;
   }
 }
 
@@ -130,7 +133,7 @@ html.mm-opening .mm-menu.mm-opened[class*=mm-pagedim]~#mm-blocker {
   height: 60px;
   padding: 22px !important; // Controls size of icon and position within the element
   color: @menu-text;
-  background-color: overlay(@menu-background, #c0c0c0);
+  background-color: @menu-button-background;
 }
 
 
@@ -218,6 +221,10 @@ html.mm-opening .mm-menu.mm-opened[class*=mm-pagedim]~#mm-blocker {
   overflow-y: auto;
   padding-top: 20px;
 
+  a {
+    padding: 0;
+  }
+
   .doubleThumb {
     display: block !important;
     margin: 10px auto 40px auto !important;
@@ -237,4 +244,28 @@ html.mm-opening .mm-menu.mm-opened[class*=mm-pagedim]~#mm-blocker {
   .no-results {
     padding: 5px 25px;
   }
+}
+
+
+#shareLinks {
+  position: absolute;
+  bottom: 0;
+  left: 0;
+  width: 100%;
+  background-color: @menu-button-background;
+  line-height: 1;
+  padding: 20px 0;
+
+  .share-icons {
+    display: flex;
+    justify-content: space-around;
+  }
+  a {
+    padding: 0;
+
+    img {
+      margin: 0;
+    }
+  }
+
 }
\ No newline at end of file