]> _ Git - fluidbook-html5.git/commitdiff
wip #2015 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Mar 2018 13:40:27 +0000 (15:40 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 30 Mar 2018 13:40:27 +0000 (15:40 +0200)
images/shadows/back/left.png
images/shadows/back/right.png
js/libs/fluidbook/fluidbook.nav.js

index 99e9f4cd1ee5bde392bccbe1ca0ccfa6bf4c7f71..b19cae2aad8a99f928ba158b26d6f61638f55879 100644 (file)
Binary files a/images/shadows/back/left.png and b/images/shadows/back/left.png differ
index 2326dfba8673dd1e7bff3f84df5d99bade113513..b9556bc6604c1307b131bd2503ccd51f21efcd0b 100644 (file)
Binary files a/images/shadows/back/right.png and b/images/shadows/back/right.png differ
index c62713c2979acbd41c5f36cc61b3b06c9842d076..3ea67a1e6d623e4283bdcaf66ab95bd2cc636af4 100644 (file)
@@ -319,6 +319,8 @@ FluidbookNav.prototype = {
 
         var $this = this;
 
+        var extraNPerURL = {};
+
         for (var i in thisall) {
             var icon = thisall[i];
             var visible = hide.indexOf(icon) == -1;
@@ -483,7 +485,6 @@ FluidbookNav.prototype = {
                 if ((extraVisibility == 'horizontal' && navType == 'menu') || (extraVisibility == 'burger' && navType == 'horizontalNav')) {
                     continue;
                 }
-
                 var linkIcon;
 
                 if (extraIcon.indexOf('.') === -1) {
@@ -491,18 +492,21 @@ FluidbookNav.prototype = {
                 } else {
                     if (extraIcon.indexOf('.svg') >= 0) {
                         if (getSpriteIcon('extra-extra' + n) == '') {
+                            var url = 'data/images/' + extraIcon;
+                            extraNPerURL[url] = n;
                             $.ajax({
-                                url: 'data/images/' + extraIcon,
+                                url: url,
                                 type: 'GET',
                                 dataType: 'xml',
                                 success: function (data) {
+                                    var n1 = extraNPerURL[this.url];
                                     var svg = $(data).find('svg');
                                     var viewbox = $(svg).attr('viewBox');
                                     var maing = $(svg).children('g').eq(0);
-                                    if ($("#extra-extra" + n).length == 0) {
-                                        $("#svg-container").append('<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><symbol id="extra-extra' + n + '" viewBox="' + viewbox + '">' + maing.html() + '</symbol></svg>');
+                                    if ($("#extra-extra" + n1).length == 0) {
+                                        $("#svg-container").append('<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><symbol id="extra-extra' + n1 + '" viewBox="' + viewbox + '"><g>' + $("<g/>").append($(maing).clone()).html() + '</g></symbol></svg>');
                                     }
-                                    $('#spare_extra' + n).replaceWith(getSpriteIcon('extra-extra' + n));
+                                    $('#spare_extra' + n1).replaceWith(getSpriteIcon('extra-extra' + n1));
                                 },
                             });
 
@@ -669,16 +673,6 @@ FluidbookNav.prototype = {
 
         // Bookmarks icon
         $(document).on('click', '.icon-bookmarks', function () {
-            if (!$this.fluidbook.bookmarks.hasBookmarkedPages()) {
-                var message = $this.fluidbook.l10n.__("you don't have any bookmarks");
-                if ($this.fluidbook.datas.phonegap) {
-                    navigator.notification.alert(message, function () {
-                    }, $this.fluidbook.l10n.__('bookmarks'));
-                } else {
-                    window.alert(message);
-                }
-                return false;
-            }
             if ($(this).data('extra') != null) {
                 $this.fluidbook.menu.openView('bookmark', $(this).data('extra'), null, function () {
                 });