Skip to content

Commit

Permalink
helpful Search only visible in advance mode (#4203)
Browse files Browse the repository at this point in the history
* helpfulSearch only visible in advance mode

* helpful search only visible in advance mode

* helpful search only visible in advance mode
  • Loading branch information
subhas-pramanik-09 authored Dec 29, 2024
1 parent da7a2ef commit 4e2bb77
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions js/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -452,16 +452,11 @@ class Activity {
// Append the closeButtonDiv to the helpfulSearchDiv
this.helpfulSearchDiv.appendChild(closeButtonDiv);

// Add event listener to remove the search div from the DOM when clicked on the close button
closeButton.addEventListener("click", () => {
this.helpfulSearchDiv.parentNode.removeChild(this.helpfulSearchDiv); // Remove from DOM
});
// Add event listener to remove the search div from the DOM
const modeButton = docById("begIconText");
closeButton.addEventListener("click", this._hideHelpfulSearchWidget);
modeButton.addEventListener("click", this._hideHelpfulSearchWidget);

if (docById("helpfulSearch")) {
docById("helpfulSearch").parentNode.removeChild(
docById("helpfulSearch")
);
}
this.helpfulSearchDiv.appendChild(this.helpfulSearchWidget);
}

Expand Down Expand Up @@ -498,6 +493,9 @@ class Activity {
if (docById("helpfulWheelDiv").style.display !== "none") {
docById("helpfulWheelDiv").style.display = "none";
}
if (this.helpfulSearchDiv && this.helpfulSearchDiv.parentNode) {
this.helpfulSearchDiv.parentNode.removeChild(this.helpfulSearchDiv);
}
that.__tick();
}

Expand Down Expand Up @@ -2391,6 +2389,9 @@ class Activity {
// Bring widget to top.
this.searchWidget.style.zIndex = 1001;
this.searchWidget.style.border = "2px solid blue";
if (this.helpfulSearchDiv) {
this._hideHelpfulSearchWidget();
}
if (this.searchWidget.style.visibility === "visible") {
this.hideSearchWidget();
} else {
Expand Down

0 comments on commit 4e2bb77

Please sign in to comment.