Revert "FEATURE: CTRL-SHIFT-ENTER and SHIFT-Click do not scroll on post (#10939)"

This broke "composePrivateMessage" (and possibly others) because `d-button` now passes the event as a
second argument, and that action has an optional second argument.
This commit is contained in:
Robin Ward 2020-10-19 14:02:49 -04:00
parent 6051a3da68
commit 5597aeb1b9
3 changed files with 8 additions and 9 deletions

View File

@ -89,7 +89,7 @@ export default Component.extend({
return computedLabel; return computedLabel;
}, },
click(event) { click() {
let { action } = this; let { action } = this;
if (action) { if (action) {
@ -98,9 +98,9 @@ export default Component.extend({
// There is already a warning in the console. // There is already a warning in the console.
this.sendAction("action", this.actionParam); this.sendAction("action", this.actionParam);
} else if (typeof action === "object" && action.value) { } else if (typeof action === "object" && action.value) {
action.value(this.actionParam, event); action.value(this.actionParam);
} else if (typeof this.action === "function") { } else if (typeof this.action === "function") {
action(this.actionParam, event); action(this.actionParam);
} }
} }

View File

@ -546,8 +546,8 @@ export default Controller.extend({
this.cancelComposer(differentDraftContext); this.cancelComposer(differentDraftContext);
}, },
save(ignore, event) { save() {
this.save(false, { jump: !(event && event.shiftKey) }); this.save();
}, },
displayEditReason() { displayEditReason() {
@ -625,7 +625,7 @@ export default Controller.extend({
disableSubmit: or("model.loading", "isUploading"), disableSubmit: or("model.loading", "isUploading"),
save(force, options = {}) { save(force) {
if (this.disableSubmit) { if (this.disableSubmit) {
return; return;
} }
@ -763,8 +763,7 @@ export default Controller.extend({
this.currentUser.set("any_posts", true); this.currentUser.set("any_posts", true);
const post = result.target; const post = result.target;
if (post && !staged) {
if (post && !staged && options.jump !== false) {
DiscourseURL.routeTo(post.url, { skipIfOnScreen: true }); DiscourseURL.routeTo(post.url, { skipIfOnScreen: true });
} }
}) })

View File

@ -14,7 +14,7 @@ export default {
// //
// iPad physical keyboard does not offer Command or Control detection // iPad physical keyboard does not offer Command or Control detection
// so use ALT-ENTER // so use ALT-ENTER
this.save(undefined, e); this.save();
return false; return false;
} }
}, },