Skip to content

Commit

Permalink
refs #40870. Add user preference check for sidePanel in mailingEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
poliphilochu committed Jul 6, 2024
1 parent 543ee3c commit bc59d4c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions packages/mailingEditor/mailingEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1667,8 +1667,10 @@
_checkPanelOpen();
}
});
// check default open
_checkPanelOpen();

if (!window.neticrmSidePanelOptions.userPreference) {
_checkPanelOpen();
}

$("#Upload").off("click").on("click", ".form-submit", function(event) {
$(this).closest("form").data("action", $(this).attr("name"));
Expand Down Expand Up @@ -3054,12 +3056,10 @@
this.initialized = true;
},
open: function() {
$(_panels).addClass("is-opened");
$("body").addClass("nsp-is-opened");
window.neticrmSidePanelInstance ? window.neticrmSidePanelInstance.open() : $(_panels).addClass("is-opened");
},
close: function() {
$(_panels).removeClass("is-opened");
$("body").removeClass("nsp-is-opened");
window.neticrmSidePanelInstance ? window.neticrmSidePanelInstance.close() : $(_panels).removeClass("is-opened");
}
}

Expand Down
1 change: 1 addition & 0 deletions templates/CRM/common/sidePanel.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
neticrmSidePanelOpts.fullscreen = "{/literal}{$fullscreen}{literal}";
neticrmSidePanelOpts.userPreference = "{/literal}{$userPreference}{literal}";
neticrmSidePanelOpts.debugMode = "{/literal}{$config->debug}{literal}";
window.neticrmSidePanelOptions = neticrmSidePanelOpts;
window.neticrmSidePanelInstance = $(".nsp-container").neticrmSidePanel(".nsp-container", neticrmSidePanelOpts);
});
})(cj);
Expand Down

0 comments on commit bc59d4c

Please sign in to comment.