Skip to content

Commit

Permalink
fix: don't apply modal override styles on flarum 1.5+
Browse files Browse the repository at this point in the history
  • Loading branch information
davwheat committed Aug 14, 2022
1 parent 04e07de commit dee18ac
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
9 changes: 9 additions & 0 deletions js/src/forum/utils/overrideModalManager.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import ModalManager from 'flarum/forum/components/ModalManager';
import { override } from 'flarum/common/extend';
import OverrideModalState from '../states/OverrideModalState';
import app from 'flarum/forum/app';

/**
* Notice from V17: Temporary override due to lack of multi-dialogs!
Expand All @@ -18,6 +19,14 @@ export default function overrideModalManager() {
return;
}

const style = document.createElement('style');
style.innerHTML = `
#modal .ModalManager:not(:last-child),
.modal-backdrop.in:not(:last-child) {
opacity: 0;
}`;
document.head.appendChild(style);

app.modal = new OverrideModalState();

override(ModalManager.prototype, 'view', function () {
Expand Down
5 changes: 0 additions & 5 deletions less/Forum.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,3 @@
@import "./Forum/Item.less";
@import "./Forum/BlogSideWidget.less";
@import "./Forum/Composer.less";

#modal .ModalManager:not(:last-child),
.modal-backdrop.in:not(:last-child) {
opacity: 0;
}

0 comments on commit dee18ac

Please sign in to comment.