From 76565a8b2844e504a22b499398288552b5f98d10 Mon Sep 17 00:00:00 2001 From: Bachir Soussi Chiadmi Date: Tue, 13 Mar 2018 19:46:48 +0100 Subject: [PATCH] fix footer menu, fix #4 --- .../assets/dist/scripts/corpus.min.js | 17 +++------------- .../edlp_corpus/assets/scripts/corpus.js | 17 +++------------- .../edlptheme/assets/dist/scripts/main.min.js | 15 +++++++++++--- .../edlptheme/assets/dist/styles/app.min.css | 20 +++++++++++++++++++ .../custom/edlptheme/assets/scripts/main.js | 15 +++++++++++--- .../custom/edlptheme/assets/styles/app.scss | 17 ++++++++++++++++ 6 files changed, 67 insertions(+), 34 deletions(-) diff --git a/sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js b/sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js index 2e7bffbb9..4298fe743 100644 --- a/sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js +++ b/sites/all/modules/figli/edlp_corpus/assets/dist/scripts/corpus.min.js @@ -332,20 +332,6 @@ this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(0.75); break; } - // if( - // (this.x < this.wall_limits.left && this.p.velocity.x < 0) - // || (this.x > this.wall_limits.right && this.p.velocity.x > 0) - // ){ - // // console.log("bounce x"); - // this.p.velocity.multiplyScalarXY(-1, 1).multiplyScalar(0.75); - // } - // if( - // (this.y < this.wall_limits.top && this.p.velocity.y < 0) - // || (this.y > this.wall_limits.bottom && this.p.velocity.y > 0) - // ){ - // // console.log("bounce y"); - // this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(0.75); - // } }; Node.prototype.updatePos = function(){ @@ -673,10 +659,13 @@ _$entrees_block_termlinks.parents('li').removeClass('opened'); $li.addClass('opened'); filterEntree(tid); + _$body.trigger({'type':'open_entree', 'tid':tid}); }else{ $li.removeClass('opened'); scrambleCollection(); + _$body.trigger({'type':'close_entree', 'tid':tid}); } + return false; }); diff --git a/sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js b/sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js index 2e7bffbb9..4298fe743 100644 --- a/sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js +++ b/sites/all/modules/figli/edlp_corpus/assets/scripts/corpus.js @@ -332,20 +332,6 @@ this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(0.75); break; } - // if( - // (this.x < this.wall_limits.left && this.p.velocity.x < 0) - // || (this.x > this.wall_limits.right && this.p.velocity.x > 0) - // ){ - // // console.log("bounce x"); - // this.p.velocity.multiplyScalarXY(-1, 1).multiplyScalar(0.75); - // } - // if( - // (this.y < this.wall_limits.top && this.p.velocity.y < 0) - // || (this.y > this.wall_limits.bottom && this.p.velocity.y > 0) - // ){ - // // console.log("bounce y"); - // this.p.velocity.multiplyScalarXY(1,-1).multiplyScalar(0.75); - // } }; Node.prototype.updatePos = function(){ @@ -673,10 +659,13 @@ _$entrees_block_termlinks.parents('li').removeClass('opened'); $li.addClass('opened'); filterEntree(tid); + _$body.trigger({'type':'open_entree', 'tid':tid}); }else{ $li.removeClass('opened'); scrambleCollection(); + _$body.trigger({'type':'close_entree', 'tid':tid}); } + return false; }); diff --git a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js index 3e18a8f20..782f31f07 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js +++ b/sites/all/themes/custom/edlptheme/assets/dist/scripts/main.min.js @@ -52,9 +52,18 @@ edlp_vars = { function initEvents(){ - $('body').on('on-studio-chutier-updated', function(e){ - initAjaxLinks(); - }); + $('body') + .on('on-studio-chutier-updated', function(e){ + initAjaxLinks(); + }) + .on('open_entree', function(e){ + // e.tid available + closeAllModals(); + }) + .on('close_entree', function(e){ + // e.tid available + closeAllModals(); + }); } // _ _ _ diff --git a/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css b/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css index 4632d967e..358923f5d 100644 --- a/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css +++ b/sites/all/themes/custom/edlptheme/assets/dist/styles/app.min.css @@ -1771,6 +1771,26 @@ footer { white-space: nowrap; } footer nav.block-menu ul li:first-of-type { margin-left: 1em; } + footer nav.block-menu ul li a:before { + content: ""; + display: inline-block; + width: 7px; + height: 7px; + border: 1px solid black; + margin-right: 0.5em; } + footer nav.block-menu ul li a:hover:before, footer nav.block-menu ul li a.is-active:before { + background-color: black; } + footer nav.block-menu ul li a.ajax-loading:before { + -webkit-animation: rotation 2s infinite linear; + animation: rotation 2s infinite linear; } + +@keyframes rotation { + from { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); } + to { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); } } footer .block-language { display: inline-block; position: relative; } diff --git a/sites/all/themes/custom/edlptheme/assets/scripts/main.js b/sites/all/themes/custom/edlptheme/assets/scripts/main.js index 269bf569c..4e5911f0a 100644 --- a/sites/all/themes/custom/edlptheme/assets/scripts/main.js +++ b/sites/all/themes/custom/edlptheme/assets/scripts/main.js @@ -29,9 +29,18 @@ function initEvents(){ - $('body').on('on-studio-chutier-updated', function(e){ - initAjaxLinks(); - }); + $('body') + .on('on-studio-chutier-updated', function(e){ + initAjaxLinks(); + }) + .on('open_entree', function(e){ + // e.tid available + closeAllModals(); + }) + .on('close_entree', function(e){ + // e.tid available + closeAllModals(); + }); } // _ _ _ diff --git a/sites/all/themes/custom/edlptheme/assets/styles/app.scss b/sites/all/themes/custom/edlptheme/assets/styles/app.scss index 405fd8891..02e762cc7 100644 --- a/sites/all/themes/custom/edlptheme/assets/styles/app.scss +++ b/sites/all/themes/custom/edlptheme/assets/styles/app.scss @@ -754,6 +754,23 @@ footer{ &:first-of-type{ margin-left: 1em; } + a{ + &:before{ + content: ""; + display:inline-block; + $sq:7px; + width: $sq; height:$sq; + border: 1px solid black; + margin-right: 0.5em; + } + &:hover:before, + &.is-active:before{ + background-color: black; + } + &.ajax-loading:before{ + @include spining-loader-square; + } + } } } }