1
0
mirror of https://github.com/flarum/core.git synced 2025-08-08 17:36:38 +02:00

Retain global page components between routes

This commit is contained in:
Toby Zerner
2016-04-08 13:38:16 +09:30
parent 01c0cf443b
commit 6dd190114d
8 changed files with 94 additions and 8 deletions

View File

@@ -1,8 +1,6 @@
import Component from 'flarum/Component';
import ItemList from 'flarum/utils/ItemList';
import listItems from 'flarum/helpers/listItems';
import SelectDropdown from 'flarum/components/SelectDropdown';
import Button from 'flarum/components/Button';
/**
* The `HeaderPrimary` component displays primary header controls. On the
@@ -17,6 +15,13 @@ export default class HeaderPrimary extends Component {
);
}
config(isInitialized, context) {
// Since this component is 'above' the content of the page (that is, it is a
// part of the global UI that persists between routes), we will flag the DOM
// to be retained across route changes.
context.retain = true;
}
/**
* Build an item list for the controls.
*

View File

@@ -22,6 +22,13 @@ export default class HeaderSecondary extends Component {
);
}
config(isInitialized, context) {
// Since this component is 'above' the content of the page (that is, it is a
// part of the global UI that persists between routes), we will flag the DOM
// to be retained across route changes.
context.retain = true;
}
/**
* Build an item list for the controls.
*