Skip to content

Commit

Permalink
chore: refactor addEventListenerCompatibilityForPlugins
Browse files Browse the repository at this point in the history
  • Loading branch information
kingjia90 authored and dvesh3 committed May 12, 2023
1 parent b806280 commit 76771a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Resources/public/js/pimcore/perspective/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ pimcore.events.onPerspectiveEditorLoadStructureForPermissions = "pimcore.perspec



//TODO: delete in Pimcore11 and update dependency in composer.json
//TODO: delete once support for Pimcore 10.6 is dropped
if(typeof addEventListenerCompatibilityForPlugins === "function") {
let eventMappings = [];
eventMappings["onPerspectiveEditorLoadPermissions"] = pimcore.events.onPerspectiveEditorLoadPermissions;
eventMappings["onPerspectiveEditorLoadStructureForPermissions"] = pimcore.events.onPerspectiveEditorLoadStructureForPermissions;
addEventListenerCompatibilityForPlugins(eventMappings);
} else {
console.error("Delete addEventListenerCompatibilityForPlugins in the perspective-editor")
console.warn("Deprecation: addEventListenerCompatibilityForPlugins will be not supported in Pimcore 11.");
}

0 comments on commit 76771a2

Please sign in to comment.