]> _ Git - fluidbook-html5.git/commitdiff
try #1454 @3
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2017 14:00:48 +0000 (16:00 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 7 Jun 2017 14:00:48 +0000 (16:00 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.menu.js
js/main.js
style/fluidbook.less

index 67fa121955a76b8ba8445b0bb7d9f1bb64ee2409..4917f6847c9f6441ef8dba2f244052327c4225bb 100644 (file)
@@ -131,7 +131,7 @@ Fluidbook.prototype = {
         this.ready();
         $("#main").css('visibility', 'visible');
         this.hideLoader(0, true);
-     
+
         if (this.support.transitions2d) {
             $("#splash").css('opacity', 0).one(this.support.getTransitionEndEvent(true), function () {
                 $(this).remove();
index 735d6c8cd12ee1d0f03bfe2daf089d24d4118112..161ac8100e329d35a455331c044bd123b042a294 100644 (file)
@@ -6,6 +6,44 @@ function FluidbookMenu(fluidbook) {
 FluidbookMenu.prototype = {
     init: function () {
         this.index = new FluidbookIndex(this.fluidbook);
+        var $this = this;
+
+        $(document).on('click', ".mview .back", function () {
+            if ($(this).hasClass('closeView')) {
+                fluidbook.menu.closeView(function () {
+                }, false);
+                if ($(this).is('[href]')) {
+                    maskHashChange = true;
+                    window.location = $(this).attr('href');
+                    setTimeout(function () {
+                        maskHashChange = false;
+                    }, 200);
+                }
+                return false;
+            }
+            if ($(this).hasClass('one')) {
+                fluidbook.menu.closeView(function () {
+                }, false);
+
+                if ($(this).is('[href]')) {
+                    maskHashChange = true;
+                    window.location = $(this).attr('href');
+                    setTimeout(function () {
+                        maskHashChange = false;
+                    }, 200);
+                } else {
+                    maskHashChange = true;
+                    history.back();
+                    setTimeout(function () {
+                        maskHashChange = false;
+                    }, 200);
+                }
+                return false;
+            }
+            window.location.hash = '/page/' + $this.fluidbook.currentPage;
+            return false;
+        });
+
     },
 
     viewMode: function () {
@@ -212,7 +250,7 @@ FluidbookMenu.prototype = {
         } else {
             c = ' ' + c;
         }
-        return '<a href="#" class="back' + c + '">' + getSpriteIcon('interface-close') + '</a>';
+        return '<div class="button back' + c + '">' + getSpriteIcon('interface-close') + '</div>';
     }
     ,
     openAudio: function (audio, callback) {
@@ -412,7 +450,7 @@ FluidbookMenu.prototype = {
         }
 
 
-        if(mview.length>0) {
+        if (mview.length > 0) {
             TweenMax.to(mview, 0.25, {
                 autoAlpha: 0, onComplete: function () {
                     $this.fluidbook.video.killVideosIn(mview);
@@ -536,7 +574,7 @@ FluidbookMenu.prototype = {
             default:
                 break;
         }
-        
+
         var captionHeight = m.find('.caption').outerHeight();
         css = {};
         ccss = {};
index 0d8dfe36c73c5010a1f3c91b5bd2a904b796142b..566df1817b2f8b5b50a91421c5b8149486abc238 100644 (file)
@@ -368,45 +368,6 @@ try {
 
         $("#logo").click(clickLogo);
 
-        $(document).on('click', ".mview .back", function () {
-            if ($(this).hasClass('closeView')) {
-                fluidbook.menu.closeView(function () {
-                }, false);
-                if ($(this).attr('href') != '#') {
-                    maskHashChange = true;
-                    window.location = $(this).attr('href');
-                    setTimeout(function () {
-                        maskHashChange = false;
-                    }, 200);
-
-                }
-                return false;
-            }
-            if ($(this).hasClass('one')) {
-                fluidbook.menu.closeView(function () {
-                }, false);
-
-                if ($(this).attr('href') != '#') {
-                    maskHashChange = true;
-                    window.location = $(this).attr('href');
-                    setTimeout(function () {
-                        maskHashChange = false;
-                    }, 200);
-                } else {
-                    maskHashChange = true;
-                    history.back();
-                    setTimeout(function () {
-                        maskHashChange = false;
-                    }, 200);
-                }
-                return false;
-            }
-            if ($(this).attr('href') == '#') {
-                window.location.hash = '/page/' + fluidbook.currentPage;
-                return false;
-            }
-        });
-
         $(document).on('click', '.lazy', function () {
             return false;
         });
@@ -418,7 +379,7 @@ try {
             return false;
         });
 
-        $(document).on('click', 'a', function () {
+        $(document).on('click', 'a', function () { 
             if (!DATAS.phonegap) {
                 return true;
             }
index ebfab845377a2555974bc5c16b7da4e22f0e96de..988f809e7ee90048261540064f793200b8208459 100644 (file)
@@ -847,7 +847,7 @@ footer.hidden, header.hidden, #interface.hidden {
                .caption {
                        height: 0;
                        padding: 0;
-                       .back {
+                       div.button.back {
                                width: 30px;
                                height: 30px;
                                padding: 10px;
@@ -917,12 +917,13 @@ footer.hidden, header.hidden, #interface.hidden {
                        white-space: nowrap;
                }
 
-               a {
+               div.button, a {
                        height: 27px;
                        font-weight: 600;
                        font-size: 14px;
                        line-height: 25px;
                        display: block;
+                       cursor: pointer;
                        &.back {
                                position: absolute;
                                top: 0;