diff --git a/app/assets/javascripts/discourse/app/controllers/bookmark.js b/app/assets/javascripts/discourse/app/controllers/bookmark.js index 05a4c26b530..c2a6b5585ac 100644 --- a/app/assets/javascripts/discourse/app/controllers/bookmark.js +++ b/app/assets/javascripts/discourse/app/controllers/bookmark.js @@ -1,4 +1,5 @@ import I18n from "I18n"; +import { schedule } from "@ember/runloop"; import { and } from "@ember/object/computed"; import { next } from "@ember/runloop"; import { action } from "@ember/object"; @@ -89,6 +90,12 @@ export default Controller.extend(ModalFunctionality, { if (this._editingExistingBookmark()) { this._initializeExistingBookmarkData(); } + + schedule("afterRender", () => { + if (this.site.isMobileDevice) { + document.getElementById("bookmark-name").blur(); + } + }); }, /** @@ -212,8 +219,7 @@ export default Controller.extend(ModalFunctionality, { showLastCustom: and("lastCustomReminderTime", "lastCustomReminderDate"), - @discourseComputed() - showLaterToday() { + get showLaterToday() { let later = this.laterToday(); return ( !later.isSame(this.tomorrow(), "date") && @@ -221,8 +227,7 @@ export default Controller.extend(ModalFunctionality, { ); }, - @discourseComputed() - showLaterThisWeek() { + get showLaterThisWeek() { return this.now().day() < MOMENT_THURSDAY; }, @@ -238,35 +243,36 @@ export default Controller.extend(ModalFunctionality, { return formattedReminderTime(existingReminderAt, this.userTimezone); }, - @discourseComputed() - startNextBusinessWeekFormatted() { + get startNextBusinessWeekLabel() { + if (this.now().day() === MOMENT_MONDAY) { + return I18n.t("bookmarks.reminders.start_of_next_business_week_alt"); + } + return I18n.t("bookmarks.reminders.start_of_next_business_week"); + }, + + get startNextBusinessWeekFormatted() { return this.nextWeek() .day(MOMENT_MONDAY) .format(I18n.t("dates.long_no_year")); }, - @discourseComputed() - laterTodayFormatted() { + get laterTodayFormatted() { return this.laterToday().format(I18n.t("dates.time")); }, - @discourseComputed() - tomorrowFormatted() { + get tomorrowFormatted() { return this.tomorrow().format(I18n.t("dates.time_short_day")); }, - @discourseComputed() - nextWeekFormatted() { + get nextWeekFormatted() { return this.nextWeek().format(I18n.t("dates.long_no_year")); }, - @discourseComputed() - laterThisWeekFormatted() { + get laterThisWeekFormatted() { return this.laterThisWeek().format(I18n.t("dates.time_short_day")); }, - @discourseComputed() - nextMonthFormatted() { + get nextMonthFormatted() { return this.nextMonth().format(I18n.t("dates.long_no_year")); }, diff --git a/app/assets/javascripts/discourse/app/templates/modal/bookmark.hbs b/app/assets/javascripts/discourse/app/templates/modal/bookmark.hbs index 17f41b174ef..87d75375c14 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/bookmark.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/bookmark.hbs @@ -51,7 +51,7 @@ {{/tap-tile}} {{/if}} {{#tap-tile icon="briefcase" tileId=reminderTypes.START_OF_NEXT_BUSINESS_WEEK activeTile=grid.activeTile onChange=(action "selectReminderType")}} -