From e23036204b599b1aa05bf338592098f829444b0e Mon Sep 17 00:00:00 2001 From: navaneethsnair1 Date: Fri, 18 Oct 2024 13:48:24 +0530 Subject: [PATCH] resolving bugs in singlepane guide --- src/main/content/_assets/css/guide-multipane-static.scss | 6 ------ src/main/content/_assets/js/guide-common.js | 5 +---- src/main/content/_assets/js/guide-multipane-static.js | 4 ++-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/main/content/_assets/css/guide-multipane-static.scss b/src/main/content/_assets/css/guide-multipane-static.scss index 9182bf1ef..994119f96 100644 --- a/src/main/content/_assets/css/guide-multipane-static.scss +++ b/src/main/content/_assets/css/guide-multipane-static.scss @@ -128,12 +128,6 @@ margin-right: 0; } - .code_command{ - &.unclickable{ - pointer-events: none; - } - } - .view_code,.copy_to_clipboard{ pointer-events: auto; } diff --git a/src/main/content/_assets/js/guide-common.js b/src/main/content/_assets/js/guide-common.js index 414dae6e6..594a3f37c 100644 --- a/src/main/content/_assets/js/guide-common.js +++ b/src/main/content/_assets/js/guide-common.js @@ -486,11 +486,8 @@ $(document).ready(function () { $('.code_command .code_block_wrapper').each(function (){ $(this).prepend('
View Code
'); }); - - (inSingleColumnView()) ? $(".code_command").addClass("unclickable") : $(".code_command").removeClass("unclickable"); - + $(window).on("resize", function () { - (inSingleColumnView()) ? $(".code_command").addClass("unclickable") : $(".code_command").removeClass("unclickable"); if (!inSingleColumnView()){ $("#code_column").css("top", "0px"); } diff --git a/src/main/content/_assets/js/guide-multipane-static.js b/src/main/content/_assets/js/guide-multipane-static.js index eed8fd49d..29edd5e0f 100644 --- a/src/main/content/_assets/js/guide-multipane-static.js +++ b/src/main/content/_assets/js/guide-multipane-static.js @@ -763,7 +763,7 @@ $(document).ready(function () { // In mobile view if the user clicks a hotspot it shows a modal of the file with the hotspot code highlighted. $(".hotspot,.view_code").on("click", function (e) { - if (inSingleColumnView() && !$(e.target).closest('.copy_to_clipboard').length){ + if (inSingleColumnView() && !$(this).hasClass('code_command')){ $("body").addClass("unscrollable"); $("#mobile_toc_accordion_container").css({ "display":"none" @@ -772,7 +772,7 @@ $(document).ready(function () { $("#code_column").css({ top: "0px", }); - handleHotspotHover($(this)); + ($(this).is('.view_code'))?handleHotspotHover($(this).closest('.hotspot')):handleHotspotHover($(this)); } });