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.
42 lines
1.1 KiB
JavaScript
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);
|
|
}
|
|
}
|
|
});
|