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

Merge branch 'master' into 1236-database-changes

This commit is contained in:
Toby Zerner
2018-08-24 17:03:50 +09:30
26 changed files with 263 additions and 143 deletions

View File

@@ -46,11 +46,14 @@ export default class ExtensionsPage extends Page {
{controls}
</Dropdown>
) : ''}
<label className="ExtensionListItem-title">
<input type="checkbox" checked={this.isEnabled(extension.id)} onclick={this.toggle.bind(this, extension.id)}/> {' '}
{extension.extra['flarum-extension'].title}
</label>
<div className="ExtensionListItem-version">{extension.version}</div>
<div className="ExtensionListItem-main">
<label className="ExtensionListItem-title">
<input type="checkbox" checked={this.isEnabled(extension.id)} onclick={this.toggle.bind(this, extension.id)}/> {' '}
{extension.extra['flarum-extension'].title}
</label>
<div className="ExtensionListItem-version">{extension.version}</div>
<div className="ExtensionListItem-description">{extension.description}</div>
</div>
</div>
</li>;
})}

View File

@@ -75,7 +75,7 @@ export default class Store {
* Make a request to the API to find record(s) of a specific type.
*
* @param {String} type The resource type.
* @param {Integer|Integer[]|Object} [id] The ID(s) of the model(s) to retreive.
* @param {Integer|Integer[]|Object} [id] The ID(s) of the model(s) to retrieve.
* Alternatively, if an object is passed, it will be handled as the
* `query` parameter.
* @param {Object} [query]

View File

@@ -19,7 +19,9 @@ export default class LoadingIndicator extends Component {
return <div {...attrs}>{m.trust('&nbsp;')}</div>;
}
config() {
config(isInitialized) {
if (isInitialized) return;
const options = { zIndex: 'auto', color: this.$().css('color') };
switch (this.props.size) {

View File

@@ -49,7 +49,7 @@ export default class ModalManager extends Component {
this.showing = true;
this.component = component;
app.current.retain = true;
if (app.current) app.current.retain = true;
m.redraw(true);

View File

@@ -37,7 +37,7 @@ export default class ForumApplication extends Application {
/**
* The page's search component instance.
*
* @type {SearchBox}
* @type {Search}
*/
search = new Search();

View File

@@ -115,6 +115,12 @@ export default class DiscussionPage extends Page {
);
}
config() {
if (this.discussion) {
app.setTitle(this.discussion.title());
}
}
/**
* Clear and reload the discussion.
*/
@@ -160,7 +166,6 @@ export default class DiscussionPage extends Page {
this.discussion = discussion;
app.history.push('discussion', discussion.title());
app.setTitle(discussion.title());
app.setTitleCount(0);
// When the API responds with a discussion, it will also include a number of

View File

@@ -38,7 +38,7 @@ export default class Search extends Component {
*
* @type {SearchSource[]}
*/
this.sources = this.sourceItems().toArray();
this.sources = null;
/**
* The number of sources that are still loading results.
@@ -74,6 +74,15 @@ export default class Search extends Component {
this.value(currentSearch || '');
}
// Initialize search sources in the view rather than the constructor so
// that we have access to app.forum.
if (!this.sources) {
this.sources = this.sourceItems().toArray();
}
// Hide the search view if no sources were loaded
if (!this.sources.length) return <div></div>;
return (
<div className={'Search ' + classList({
open: this.value() && this.hasFocus,
@@ -210,8 +219,8 @@ export default class Search extends Component {
sourceItems() {
const items = new ItemList();
items.add('discussions', new DiscussionsSearchSource());
items.add('users', new UsersSearchSource());
if (app.forum.attribute('canViewDiscussions')) items.add('discussions', new DiscussionsSearchSource());
if (app.forum.attribute('canViewUserList')) items.add('users', new UsersSearchSource());
return items;
}