mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Clicking admin menu does not hide select posts box.
This commit is contained in:
parent
2901691e87
commit
18e281606a
@ -148,6 +148,10 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_forceRefreshPostStream() {
|
||||||
|
this.appEvents.trigger("post-stream:refresh", { force: true });
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
showPostFlags(post) {
|
showPostFlags(post) {
|
||||||
return this.send("showFlags", post);
|
return this.send("showFlags", post);
|
||||||
@ -587,19 +591,24 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
this._jumpToPostId(postId);
|
this._jumpToPostId(postId);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
hideMultiSelect() {
|
||||||
|
this.set("multiSelect", false);
|
||||||
|
this._forceRefreshPostStream();
|
||||||
|
},
|
||||||
|
|
||||||
toggleMultiSelect() {
|
toggleMultiSelect() {
|
||||||
this.toggleProperty("multiSelect");
|
this.toggleProperty("multiSelect");
|
||||||
this.appEvents.trigger("post-stream:refresh", { force: true });
|
this._forceRefreshPostStream();
|
||||||
},
|
},
|
||||||
|
|
||||||
selectAll() {
|
selectAll() {
|
||||||
this.set("selectedPostIds", [...this.get("model.postStream.stream")]);
|
this.set("selectedPostIds", [...this.get("model.postStream.stream")]);
|
||||||
this.appEvents.trigger("post-stream:refresh", { force: true });
|
this._forceRefreshPostStream();
|
||||||
},
|
},
|
||||||
|
|
||||||
deselectAll() {
|
deselectAll() {
|
||||||
this.set("selectedPostIds", []);
|
this.set("selectedPostIds", []);
|
||||||
this.appEvents.trigger("post-stream:refresh", { force: true });
|
this._forceRefreshPostStream();
|
||||||
},
|
},
|
||||||
|
|
||||||
togglePostSelection(post) {
|
togglePostSelection(post) {
|
||||||
@ -613,7 +622,7 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
ajax(`/posts/${post.id}/reply-ids.json`).then(replies => {
|
ajax(`/posts/${post.id}/reply-ids.json`).then(replies => {
|
||||||
const replyIds = replies.map(r => r.id);
|
const replyIds = replies.map(r => r.id);
|
||||||
this.get("selectedPostIds").pushObjects([post.id, ...replyIds]);
|
this.get("selectedPostIds").pushObjects([post.id, ...replyIds]);
|
||||||
this.appEvents.trigger("post-stream:refresh", { force: true });
|
this._forceRefreshPostStream();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -621,7 +630,7 @@ export default Ember.Controller.extend(BufferedContent, {
|
|||||||
const stream = [...this.get("model.postStream.stream")];
|
const stream = [...this.get("model.postStream.stream")];
|
||||||
const below = stream.slice(stream.indexOf(post.id));
|
const below = stream.slice(stream.indexOf(post.id));
|
||||||
this.get("selectedPostIds").pushObjects(below);
|
this.get("selectedPostIds").pushObjects(below);
|
||||||
this.appEvents.trigger("post-stream:refresh", { force: true });
|
this._forceRefreshPostStream();
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteSelected() {
|
deleteSelected() {
|
||||||
|
@ -85,6 +85,7 @@
|
|||||||
topic=model
|
topic=model
|
||||||
fixed="true"
|
fixed="true"
|
||||||
toggleMultiSelect=(action "toggleMultiSelect")
|
toggleMultiSelect=(action "toggleMultiSelect")
|
||||||
|
hideMultiSelect=(action "hideMultiSelect")
|
||||||
deleteTopic=(action "deleteTopic")
|
deleteTopic=(action "deleteTopic")
|
||||||
recoverTopic=(action "recoverTopic")
|
recoverTopic=(action "recoverTopic")
|
||||||
toggleClosed=(action "toggleClosed")
|
toggleClosed=(action "toggleClosed")
|
||||||
@ -111,6 +112,7 @@
|
|||||||
jumpToIndex=(action "jumpToIndex")
|
jumpToIndex=(action "jumpToIndex")
|
||||||
replyToPost=(action "replyToPost")
|
replyToPost=(action "replyToPost")
|
||||||
toggleMultiSelect=(action "toggleMultiSelect")
|
toggleMultiSelect=(action "toggleMultiSelect")
|
||||||
|
hideMultiSelect=(action "hideMultiSelect")
|
||||||
deleteTopic=(action "deleteTopic")
|
deleteTopic=(action "deleteTopic")
|
||||||
recoverTopic=(action "recoverTopic")
|
recoverTopic=(action "recoverTopic")
|
||||||
toggleClosed=(action "toggleClosed")
|
toggleClosed=(action "toggleClosed")
|
||||||
@ -133,6 +135,7 @@
|
|||||||
openUpwards="true"
|
openUpwards="true"
|
||||||
rightSide="true"
|
rightSide="true"
|
||||||
toggleMultiSelect=(action "toggleMultiSelect")
|
toggleMultiSelect=(action "toggleMultiSelect")
|
||||||
|
hideMultiSelect=(action "hideMultiSelect")
|
||||||
deleteTopic=(action "deleteTopic")
|
deleteTopic=(action "deleteTopic")
|
||||||
recoverTopic=(action "recoverTopic")
|
recoverTopic=(action "recoverTopic")
|
||||||
toggleClosed=(action "toggleClosed")
|
toggleClosed=(action "toggleClosed")
|
||||||
@ -242,6 +245,7 @@
|
|||||||
{{topic-footer-buttons
|
{{topic-footer-buttons
|
||||||
topic=model
|
topic=model
|
||||||
toggleMultiSelect=(action "toggleMultiSelect")
|
toggleMultiSelect=(action "toggleMultiSelect")
|
||||||
|
hideMultiSelect=(action "hideMultiSelect")
|
||||||
deleteTopic=(action "deleteTopic")
|
deleteTopic=(action "deleteTopic")
|
||||||
recoverTopic=(action "recoverTopic")
|
recoverTopic=(action "recoverTopic")
|
||||||
toggleClosed=(action "toggleClosed")
|
toggleClosed=(action "toggleClosed")
|
||||||
|
@ -88,6 +88,7 @@ createWidget("topic-admin-menu-button", {
|
|||||||
position.left += $button.width() - 203;
|
position.left += $button.width() - 203;
|
||||||
}
|
}
|
||||||
this.state.position = position;
|
this.state.position = position;
|
||||||
|
this.sendWidgetAction("hideMultiSelect");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -241,3 +241,21 @@ QUnit.test("remove featured link", assert => {
|
|||||||
// assert.ok(!exists('.title-wrapper .topic-featured-link'), 'link is gone');
|
// assert.ok(!exists('.title-wrapper .topic-featured-link'), 'link is gone');
|
||||||
// });
|
// });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
QUnit.test("selecting posts", async assert => {
|
||||||
|
await visit("/t/internationalization-localization/280");
|
||||||
|
await click(".toggle-admin-menu");
|
||||||
|
await click(".topic-admin-multi-select .btn");
|
||||||
|
|
||||||
|
assert.ok(
|
||||||
|
exists(".selected-posts:not(.hidden)"),
|
||||||
|
"it should show the multi select menu"
|
||||||
|
);
|
||||||
|
|
||||||
|
await click(".toggle-admin-menu");
|
||||||
|
|
||||||
|
assert.ok(
|
||||||
|
exists(".selected-posts.hidden"),
|
||||||
|
"it should hide the multi select menu"
|
||||||
|
);
|
||||||
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user