FIX: only nag when pinning globally

This commit is contained in:
Régis Hanol
2015-03-19 20:05:03 +01:00
parent 11bf7da63c
commit 28c0f9dd1f
2 changed files with 7 additions and 6 deletions

View File

@@ -58,16 +58,17 @@ export default ObjectController.extend(ModalFunctionality, {
this._forwardAction(action);
} else {
this.send("hideModal");
const message = I18n.t("topic.feature_topic.confirm_" + name, { count: count });
bootbox.confirm(
message, I18n.t("no_value"), I18n.t("yes_value"),
(confirmed) => confirmed ? this._forwardAction(action) : this.send("reopenModal")
I18n.t("topic.feature_topic.confirm_" + name, { count: count }),
I18n.t("no_value"),
I18n.t("yes_value"),
confirmed => confirmed ? this._forwardAction(action) : this.send("reopenModal")
);
}
},
actions: {
pin() { this._confirmBeforePinning(this.get("pinnedInCategoryCount"), "pin", "togglePinned"); },
pin() { this._forwardAction("togglePinned"); },
pinGlobally() { this._confirmBeforePinning(this.get("pinnedGloballyCount"), "pin_globally", "pinGlobally"); },
unpin() { this._forwardAction("togglePinned"); },
makeBanner() { this._forwardAction("makeBanner"); },