From: Vincent Vanwaelscappel Date: Mon, 9 Sep 2019 16:08:59 +0000 (+0200) Subject: fix #3019 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=0ec0aa170f9534d2682fe0b0858b2ee06b9b4316;p=fluidbook-html5.git fix #3019 @1 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 1fabdfe3..febb5c5b 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -277,7 +277,6 @@ Fluidbook.prototype = { resize(); // Trigger ready event - $(this).trigger('fluidbookready'); $(this).trigger('fluidbook.ready'); $(document).trigger('fluidbook.ready'); diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 38f2c2e9..aad05109 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -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 = '
' + this.fluidbook.loader.getImage('data/images/' + this.fluidbook.datas.afterSearch) + '
'; $nav.after(afterSearchContent); diff --git a/js/libs/fluidbook/forms/fluidbook.form.bulle.js b/js/libs/fluidbook/forms/fluidbook.form.bulle.js index 40cc5a2f..cb54fab5 100644 --- a/js/libs/fluidbook/forms/fluidbook.form.bulle.js +++ b/js/libs/fluidbook/forms/fluidbook.form.bulle.js @@ -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); diff --git a/js/libs/fluidbook/special/wescosales.js b/js/libs/fluidbook/special/wescosales.js index e04a24d5..7ff3ecbc 100644 --- a/js/libs/fluidbook/special/wescosales.js +++ b/js/libs/fluidbook/special/wescosales.js @@ -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 = $(''); $.each(DATAS.basketReferences, function (k, v) { select.append(''); }); $("header nav").after('
VENTES :
'); + 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; diff --git a/js/main.js b/js/main.js index 58e87d94..9aa3a601 100644 --- a/js/main.js +++ b/js/main.js @@ -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();