From dbc24de00ba1c39069199841b9cfad63f4e7ca6a Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Mon, 26 Jul 2021 17:55:09 +1000 Subject: [PATCH 1/2] This will allow multiple timelines to be working on the same page. The current code only allows one timeline to be working on every page, the previous and next allow do not work properly if there are multiple timeline on a single page. --- dist/jquery.roadmap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dist/jquery.roadmap.js b/dist/jquery.roadmap.js index 8438cec..0d98ff4 100644 --- a/dist/jquery.roadmap.js +++ b/dist/jquery.roadmap.js @@ -168,7 +168,8 @@ /** * Handle prev click */ - if ($(this).hasClass('prev')) { + if ($this.attr('id') == $(this).parent().parent().parent().attr('id')) { + if ($(this).hasClass('prev')) { var currentSlide = $this.data('currentSlide'); if (currentSlide < 1) { @@ -202,6 +203,7 @@ build(); } + } }); $(window).on('resize', function () { From 0b5f6cbec0b2c22b1da628b91ddd35bbad527a56 Mon Sep 17 00:00:00 2001 From: Wilson Wu Date: Tue, 10 Aug 2021 11:41:09 +1000 Subject: [PATCH 2/2] Add the change to source code --- src/jquery.roadmap.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jquery.roadmap.js b/src/jquery.roadmap.js index afcea7e..7d8fa65 100644 --- a/src/jquery.roadmap.js +++ b/src/jquery.roadmap.js @@ -171,7 +171,8 @@ /** * Handle prev click */ - if ( $(this).hasClass('prev') ) { + if ($this.attr('id') == $(this).parent().parent().parent().attr('id')) { + if ($(this).hasClass('prev')) { var currentSlide = $this.data('currentSlide'); if ( currentSlide < 1 ) { @@ -204,6 +205,7 @@ }); build(); + } } });