Skip to content

Commit

Permalink
improve: compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
YUCLing committed Dec 7, 2024
1 parent 909c228 commit cf2380e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions framework/core/js/src/admin/AdminApplication.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,11 @@ export default class AdminApplication extends Application {

super.mount('', '#');

m.mount(document.getElementById('app-navigation')!, () => <Navigation className="App-backControl" drawer />);
m.mount(document.getElementById('header-navigation')!, () => <Navigation />);
m.mount(document.getElementById('header-primary')!, () => <HeaderPrimary />);
m.mount(document.getElementById('header-secondary')!, () => <HeaderSecondary />);
m.mount(document.getElementById('admin-navigation')!, () => <AdminNav />);
this.redraw.navigation = m.mount(document.getElementById('app-navigation')!, () => <Navigation className="App-backControl" drawer />);
this.redraw.headerNavigation = m.mount(document.getElementById('header-navigation')!, () => <Navigation />);
this.redraw.headerPrimary = m.mount(document.getElementById('header-primary')!, () => <HeaderPrimary />);
this.redraw.headerSecondary = m.mount(document.getElementById('header-secondary')!, () => <HeaderSecondary />);
this.redraw.adminNav = m.mount(document.getElementById('admin-navigation')!, () => <AdminNav />);
}

getRequiredPermissions(permission: string) {
Expand Down
5 changes: 5 additions & 0 deletions framework/core/js/src/common/utils/patchMithril.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export default function patchMithril(global) {
return app.routing.current;
}

modifiedMithril.route.set = function(link) {
console.warn('m.route.set is not available in v3, falling back to managed routing');
app.routing.set(link);
}

modifiedMithril.redraw = function () {
console.warn('global redraw is not available in v3, using managed global redraw for now');
app.redrawAll();
Expand Down

0 comments on commit cf2380e

Please sign in to comment.