This repository has been archived on 2023-03-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
osr-discourse-src/app/assets/javascripts/discourse/components/bookmark-actions-dropdown.js
T
Martin Brennan 8f0544137a FEATURE: Allow editing bookmark reminders (#9437)
Users can now edit the bookmark name and reminder time from their list of bookmarks.

We use "Custom" for the date and time in the modal because if the user set a reminder for "tomorrow" then edit the reminder "tomorrow", the definition of what "tomorrow" is has changed.
2020-04-17 11:08:07 +10:00

42 lines
1.1 KiB
JavaScript

import { computed } from "@ember/object";
import DropdownSelectBoxComponent from "select-kit/components/dropdown-select-box";
import { action } from "@ember/object";
export default DropdownSelectBoxComponent.extend({
classNames: ["bookmark-actions-dropdown"],
pluginApiIdentifiers: ["bookmark-actions-dropdown"],
selectKitOptions: {
icon: null,
translatedNone: "...",
showFullTitle: true
},
content: computed(() => {
return [
{
id: "remove",
icon: "trash-alt",
name: I18n.t("post.bookmarks.actions.delete_bookmark.name"),
description: I18n.t(
"post.bookmarks.actions.delete_bookmark.description"
)
},
{
id: "edit",
icon: "pencil",
name: I18n.t("post.bookmarks.actions.edit_bookmark.name"),
description: I18n.t("post.bookmarks.actions.edit_bookmark.description")
}
];
}),
@action
onChange(selectedAction) {
if (selectedAction === "remove") {
this.removeBookmark(this.bookmark);
} else if (selectedAction === "edit") {
this.editBookmark(this.bookmark);
}
}
});