From 4910b9b8a3b249bddfd67f0f7c1f1ab743e629a6 Mon Sep 17 00:00:00 2001 From: Stephen Cameron Date: Mon, 26 Jun 2017 20:59:07 +0200 Subject: [PATCH] WIP #1501 @4.5 --- js/libs/fluidbook/fluidbook.nav.js | 56 +++++++++++++++++++++++++----- style/mmenu/mmenu.less | 39 ++++++++++++++++++--- 2 files changed, 82 insertions(+), 13 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 161705c9..e52ba24d 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -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 += ''; + shareHTML += ''; + shareHTML += ''; + } + } + + // Append to menu + this.menu.find('ul').append(''); + + } else if (icon == 'bookmark') { if (this.fluidbook.datas.bookmark) { this.addLink('interface-bookmarks', '#/bookmark', 'bookmarks', 'bookmarks'); diff --git a/style/mmenu/mmenu.less b/style/mmenu/mmenu.less index 7b7226a5..f296fe69 100644 --- a/style/mmenu/mmenu.less +++ b/style/mmenu/mmenu.less @@ -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 -- 2.39.5