FIX: do not automatically route all actions to hovered posts

This feature (hitting d when a post is hovered with mouse deletes) causes a lot of confusion and is very risky.
This commit is contained in:
Sam 2018-09-06 10:34:58 +10:00
parent 8cff3c9bbc
commit 5bdc00c3be
1 changed files with 3 additions and 4 deletions

View File

@ -36,6 +36,9 @@ const bindings = {
"command+up": { handler: "goToFirstPost", anonymous: true }, "command+up": { handler: "goToFirstPost", anonymous: true },
j: { handler: "selectDown", anonymous: true }, j: { handler: "selectDown", anonymous: true },
k: { handler: "selectUp", anonymous: true }, k: { handler: "selectUp", anonymous: true },
// we use this odd routing here vs a postAction: cause like
// has an animation so the widget handles that
// TODO: teach controller how to trigger the widget animation
l: { click: ".topic-post.selected button.toggle-like" }, l: { click: ".topic-post.selected button.toggle-like" },
"m m": { handler: "setTrackingToMuted" }, // mark topic as muted "m m": { handler: "setTrackingToMuted" }, // mark topic as muted
"m r": { handler: "setTrackingToRegular" }, // mark topic as regular "m r": { handler: "setTrackingToRegular" }, // mark topic as regular
@ -301,10 +304,6 @@ export default {
$(".topic-post.selected article.boxed").data("post-id"), $(".topic-post.selected article.boxed").data("post-id"),
10 10
); );
if (!selectedPostId) {
// If no post was selected, automatically select the hovered post.
selectedPostId = parseInt($("article.boxed:hover").data("post-id"), 10);
}
if (selectedPostId) { if (selectedPostId) {
const topicController = container.lookup("controller:topic"); const topicController = container.lookup("controller:topic");
const post = topicController const post = topicController