]> _ Git - fluidbook-html5.git/commitdiff
fix #3019 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Sep 2019 16:08:59 +0000 (18:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 9 Sep 2019 16:08:59 +0000 (18:08 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.nav.js
js/libs/fluidbook/forms/fluidbook.form.bulle.js
js/libs/fluidbook/special/wescosales.js
js/main.js

index 1fabdfe316b112639f2d22840c0be8bc38cf4dcf..febb5c5b7f10080b3139b21f04633c557aa9b75a 100644 (file)
@@ -277,7 +277,6 @@ Fluidbook.prototype = {
         resize();
 
         // Trigger ready event
-        $(this).trigger('fluidbookready');
         $(this).trigger('fluidbook.ready');
         $(document).trigger('fluidbook.ready');
 
index 38f2c2e9fc35f0240cbd44c4cffba6e0e418b891..aad0510978f0ec11f5e3318946b5d4d0b5dcbfb5 100644 (file)
@@ -638,11 +638,11 @@ FluidbookNav.prototype = {
             this.initMenu();
             this.initEventHandlers();
 
-            $(this.fluidbook).trigger('fluidbooknavready');
-
+            $(this.fluidbook).trigger('fluidbook.navigation.ready');
+            $(document).trigger('fluidbook.navigation.ready');
         }
 
-        if (this.fluidbook.datas.afterSearch != '' && this.fluidbook.datas.afterSearchDisplayForHTML && this.fluidbook.datas.themeEnableAfterSearch && navType == 'horizontalNav') {
+        if (this.fluidbook.datas.afterSearch !== '' && this.fluidbook.datas.afterSearchDisplayForHTML && this.fluidbook.datas.themeEnableAfterSearch && navType == 'horizontalNav') {
             // Use the "afterSearch" image and links set in the theme and link editor
             var afterSearchContent = '<div id="afterSearch"><div class="c">' + this.fluidbook.loader.getImage('data/images/' + this.fluidbook.datas.afterSearch) + '</div><div class="links">' + this.fluidbook.datas.links.aftersearch + '</div></li>';
             $nav.after(afterSearchContent);
index 40cc5a2fe7ac72c7a40589d00dc823bd2ef69c19..cb54fab524ffc8ef8eaae0b8fac12f8c773d3017 100644 (file)
@@ -6,7 +6,7 @@ function FluidbookBulleForm(fluidbook) {
 FluidbookBulleForm.prototype = {
        init: function() {
                var $this = this;
-               $(this.fluidbook).on('fluidbookready', function() {
+               $(this.fluidbook).on('fluidbook.ready', function() {
                        setTimeout(function() {
                                $this.display();
                        }, 3000);
index e04a24d511b914b7d1f2249cf640901016274b95..7ff3ecbc64a03837b17754f202e111b651e84f0a 100644 (file)
@@ -5,23 +5,29 @@ var pagesofrefs = null;
 
 $(function () {
     $(document).on('fluidbook.init', function () {
-        $(fluidbook).on('fluidbookready', initWesco);
-        $(fluidbook).on('fluidbooknavready', initWescoNav);
+        $(fluidbook).on('fluidbook.ready', initWesco);
+        $(fluidbook).on('fluidbook.navigation.ready', initWescoNav);
         $(fluidbook).on('fluidbook.links.ready', wescoLinksReady);
         $(fluidbook).on('fluidbook.resize', wescoResize);
     });
 });
 
 function initWescoNav() {
+
+    console.log('initWescoNav');
     var select = $('<select id="wescosalesselect"></select>');
     $.each(DATAS.basketReferences, function (k, v) {
         select.append('<option value="' + k + '">' + k + '</option>');
     });
     $("header nav").after('<div id="wescosalesselector"><span>VENTES</span> : </div>');
 
+    console.log(select);
+
     $("#wescosalesselector").css({
         position: "absolute"
     }).append(select);
+
+
     $(document).on('change', "#wescosalesselect", function () {
         $(".wescosaleswindow").each(function () {
             setWescoSalesPanel($(this).data('ref'), null, true);
@@ -133,9 +139,14 @@ function getAllRefs() {
             var sheet = DATAS.basketReferences[country];
             for (var linenum in sheet) {
                 var line = sheet[linenum];
-                var r = normalizeRef(line[0].toString());
-                if (res.indexOf(r) === -1) {
-                    res.push(r);
+
+                try {
+                    var r = normalizeRef(line[0].toString());
+                    if (res.indexOf(r) === -1) {
+                        res.push(r);
+                    }
+                } catch (e) {
+                    continue;
                 }
             }
             break;
index 58e87d94e3673ce813203143af0562943d8f1e07..9aa3a601d2c6f57d9e85c5f11ecfcef41674a535 100644 (file)
@@ -253,11 +253,11 @@ try {
         }
         INITED = true;
 
-        fluidbook = new Fluidbook(DATAS);
+        window.fluidbook = new Fluidbook(DATAS);
         if (null != gal) {
             fluidbook.gal = gal;
         }
-        fluidbook.loadPlugins();
+        window.fluidbook.loadPlugins();
         $(document).trigger('fluidbook.init');
 
         desktopScale = 1;
@@ -266,7 +266,7 @@ try {
         if ($_GET.s == '1') {
             $('html').addClass('screenshot');
             $("#splash").hide();
-            fluidbook.ready();
+            window.fluidbook.ready();
         }
 
         initEvents();
@@ -380,7 +380,7 @@ try {
             return false;
         });
 
-        $(document).trigger('fluidbookready');
+        $(document).trigger('fluidbook.ready');
 
         setTimeout(function () {
             resize();