mirror of
https://github.com/flarum/core.git
synced 2025-07-23 09:41:26 +02:00
Refactor start/endComputation into lazyRedraw method
This commit is contained in:
@@ -81,7 +81,7 @@ export default class ModalManager extends Component {
|
||||
clear() {
|
||||
this.component = null;
|
||||
|
||||
m.redraw();
|
||||
m.lazyRedraw();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -13,5 +13,15 @@ export default function patchMithril(global) {
|
||||
|
||||
Object.keys(mo).forEach(key => m[key] = mo[key]);
|
||||
|
||||
/**
|
||||
* Redraw only if not in the middle of a computation (e.g. a route change).
|
||||
*
|
||||
* @return {void}
|
||||
*/
|
||||
m.lazyRedraw = function() {
|
||||
m.startComputation();
|
||||
m.endComputation();
|
||||
};
|
||||
|
||||
global.m = m;
|
||||
}
|
||||
|
Reference in New Issue
Block a user