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/app/components/bulk-select-toggle.js

18 lines
460 B
JavaScript

import Component from "@ember/component";
import { action } from "@ember/object";
import { getOwner } from "discourse-common/lib/get-owner";
export default Component.extend({
parentController: null,
@action
toggleBulkSelect() {
const controller = getOwner(this).lookup(
`controller:${this.parentController}`
);
const selection = controller.selected;
controller.toggleProperty("bulkSelectEnabled");
selection.clear();
},
});