This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/components/bookmark-actions-dropdown.js
2020-03-12 13:29:55 -04:00

34 lines
838 B
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"
)
}
];
}),
@action
onChange(selectedAction) {
if (selectedAction === "remove") {
this.removeBookmark(this.bookmark);
}
}
});