From ec5b5911fc42c07802ac17243b867848a2f775e3 Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Fri, 6 Nov 2020 16:01:23 +0530 Subject: [PATCH 01/14] Fix Double Click --- app/components/public/side-menu.js | 6 ++++-- app/templates/components/public/side-menu.hbs | 8 ++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/components/public/side-menu.js b/app/components/public/side-menu.js index 1608ba74901..c95e73ddeae 100644 --- a/app/components/public/side-menu.js +++ b/app/components/public/side-menu.js @@ -44,9 +44,11 @@ export default class SideMenu extends Component { }]; this.showSessions = this.showSessions || (await this.loader.load(`/events/${this.event.id}/sessions?fields[session]=id&page[size]=1&filter=${JSON.stringify(filters)}`)).data.length; } + didRender(){ + this.scrollToTarget(); + } - @action - scrollToTarget() { + scrollToTarget(){ document.querySelectorAll('.scroll').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); diff --git a/app/templates/components/public/side-menu.hbs b/app/templates/components/public/side-menu.hbs index cd703864100..724a7cf690f 100644 --- a/app/templates/components/public/side-menu.hbs +++ b/app/templates/components/public/side-menu.hbs @@ -1,11 +1,11 @@ {{#if (and (not-eq this.session.currentRouteName 'public.cfs.new-session') (not-eq this.session.currentRouteName 'public.cfs.new-speaker') (not-eq this.session.currentRouteName 'public.cfs.edit-speaker') (not-eq this.session.currentRouteName 'public.cfs.edit-session'))}} From 9bc59596d20d7064aa658c24c17039a1ebbb9eb6 Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Fri, 6 Nov 2020 21:16:19 +0530 Subject: [PATCH 03/14] Getting to specific section of the page from diff page-1 --- app/controllers/public.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/app/controllers/public.js b/app/controllers/public.js index a1ad1d045d3..93b2e865628 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -42,13 +42,7 @@ export default class PublicController extends Controller { goToLink(section) { this.transitionToRoute('public.index'); setTimeout(function(){ - document.querySelector(`#${section}`).scrollIntoView({ - behavior: 'smooth' - }) - document.querySelectorAll('.scroll').forEach(node => { - node.classList.remove('active'); - }); - document.querySelector(`[href='#${section}']`).classList.add('active'); + document.querySelector(`[href='#${section}']`).click(); } , 2000); } From 514e2827f7723bc27d5a3a2d5f46d74f9df9b4ca Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Sat, 7 Nov 2020 12:12:40 +0530 Subject: [PATCH 04/14] Code Cleanup --- app/components/public/side-menu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/components/public/side-menu.js b/app/components/public/side-menu.js index c95e73ddeae..2c56681023c 100644 --- a/app/components/public/side-menu.js +++ b/app/components/public/side-menu.js @@ -44,11 +44,12 @@ export default class SideMenu extends Component { }]; this.showSessions = this.showSessions || (await this.loader.load(`/events/${this.event.id}/sessions?fields[session]=id&page[size]=1&filter=${JSON.stringify(filters)}`)).data.length; } - didRender(){ + + didRender() { this.scrollToTarget(); } - scrollToTarget(){ + scrollToTarget() { document.querySelectorAll('.scroll').forEach(anchor => { anchor.addEventListener('click', function(e) { e.preventDefault(); From a35c4a5055f562b76bd19d5d228aa229f8671384 Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Sat, 7 Nov 2020 12:13:39 +0530 Subject: [PATCH 05/14] Code Cleanup-1 --- app/controllers/public.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/controllers/public.js b/app/controllers/public.js index 93b2e865628..37303f3a35b 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -40,11 +40,10 @@ export default class PublicController extends Controller { @action goToLink(section) { - this.transitionToRoute('public.index'); - setTimeout(function(){ - document.querySelector(`[href='#${section}']`).click(); - } - , 2000); + this.transitionToRoute('public.index'); + setTimeout(function() { + document.querySelector(`[href='#${section}']`).click(); + } + , 2000); } - } From 67641b131c22a73a6da5729530ac2c0296262c0b Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Sat, 7 Nov 2020 12:26:35 +0530 Subject: [PATCH 06/14] Code Cleanup-2 --- app/components/public/side-menu.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/components/public/side-menu.js b/app/components/public/side-menu.js index 2c56681023c..f7e3f9cc09e 100644 --- a/app/components/public/side-menu.js +++ b/app/components/public/side-menu.js @@ -1,5 +1,5 @@ import classic from 'ember-classic-decorator'; -import { action, computed } from '@ember/object'; +import { computed } from '@ember/object'; import Component from '@ember/component'; import moment from 'moment'; import { SPEAKERS_FILTER } from 'open-event-frontend/routes/public/speakers'; @@ -44,7 +44,7 @@ export default class SideMenu extends Component { }]; this.showSessions = this.showSessions || (await this.loader.load(`/events/${this.event.id}/sessions?fields[session]=id&page[size]=1&filter=${JSON.stringify(filters)}`)).data.length; } - + didRender() { this.scrollToTarget(); } From 9f1cd1d7014c08314a31b3a28c065f2c8ca272ef Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Sat, 7 Nov 2020 12:34:33 +0530 Subject: [PATCH 07/14] Code Cleanup-3 --- app/controllers/public.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/public.js b/app/controllers/public.js index 37303f3a35b..e4df1958aa9 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -43,7 +43,7 @@ export default class PublicController extends Controller { this.transitionToRoute('public.index'); setTimeout(function() { document.querySelector(`[href='#${section}']`).click(); - } - , 2000); - } + }, 2000) + } + } From a49989dc51f32d3b05ef30155559a028c0b99c9b Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Sat, 7 Nov 2020 12:37:51 +0530 Subject: [PATCH 08/14] Code Cleanup-4 --- app/controllers/public.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/public.js b/app/controllers/public.js index e4df1958aa9..d89551dbdc0 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -43,7 +43,7 @@ export default class PublicController extends Controller { this.transitionToRoute('public.index'); setTimeout(function() { document.querySelector(`[href='#${section}']`).click(); - }, 2000) + }, 2000); } } From 46dbab4c6eb3f1cf2e0e747a179b32ded720596e Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Tue, 10 Nov 2020 05:45:48 +0530 Subject: [PATCH 09/14] Fix Build --- translations/fr.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translations/fr.po b/translations/fr.po index 512d70a2f8b..8d8a9cc194c 100644 --- a/translations/fr.po +++ b/translations/fr.po @@ -780,7 +780,7 @@ msgstr "Merci de sélectionner votre méthode de paiement" #: app/components/forms/orders/order-form.js:479:23 #: app/components/forms/session-speaker-form.js:390:23 msgid "Please enter {{field}}" -msgstr "Veuillez entrer {{{field}}" +msgstr "Veuillez entrer {{field}}" #: app/components/forms/register-form.js:30:23 msgid "Please enter a password" From a3639074a6118e60e04f7a09492e69fc5a702385 Mon Sep 17 00:00:00 2001 From: daretobedifferent18 Date: Tue, 10 Nov 2020 06:19:47 +0530 Subject: [PATCH 10/14] Fix Build-1 --- app/templates/components/public/side-menu.hbs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/templates/components/public/side-menu.hbs b/app/templates/components/public/side-menu.hbs index 0ec7e62684a..8c8ac746b0a 100644 --- a/app/templates/components/public/side-menu.hbs +++ b/app/templates/components/public/side-menu.hbs @@ -1,11 +1,11 @@ {{#if (and (not-eq this.session.currentRouteName 'public.cfs.new-session') (not-eq this.session.currentRouteName 'public.cfs.new-speaker') (not-eq this.session.currentRouteName 'public.cfs.edit-speaker') (not-eq this.session.currentRouteName 'public.cfs.edit-session'))}} From 39ce32826abc5b581d61bef19ee950e4bf6fa4a9 Mon Sep 17 00:00:00 2001 From: iamareebjamal Date: Tue, 24 Nov 2020 14:32:50 +0530 Subject: [PATCH 14/14] fix --- app/components/public/side-menu.js | 7 +++++-- app/controllers/public.js | 5 ----- app/templates/public.hbs | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/components/public/side-menu.js b/app/components/public/side-menu.js index 7793694d5c8..c1ca64ad3f5 100644 --- a/app/components/public/side-menu.js +++ b/app/components/public/side-menu.js @@ -49,15 +49,18 @@ export default class SideMenu extends Component { } didRender() { + if (!this.activeSection) { return } const target = document.querySelector(`[href='#${this.activeSection}']`); if (target) { - target.click(); + // Delay click to give time to render + setTimeout(() => { + target.click(); + }, 0); } } @action goToSection(section) { - this.sendAction('goTo'); this.set('activeSection', section); } diff --git a/app/controllers/public.js b/app/controllers/public.js index d191e97c602..4fc5884a94b 100644 --- a/app/controllers/public.js +++ b/app/controllers/public.js @@ -33,11 +33,6 @@ export default class PublicController extends Controller { } } - @action - goTo() { - this.transitionToRoute('public.index'); - } - @action toggleMenu() { this.toggleProperty('isMenuOpen'); diff --git a/app/templates/public.hbs b/app/templates/public.hbs index 7f4cbf74ed7..fae22185d41 100644 --- a/app/templates/public.hbs +++ b/app/templates/public.hbs @@ -29,12 +29,12 @@ {{#if this.isMenuOpen}} - + {{/if}} {{/if}} {{else}}
- +
{{/if}}