discourse-data-explorer/assets/javascripts/discourse/components/explorer-schema-onetable.js...

24 lines
535 B
Plaintext
Raw Normal View History

import { on } from "discourse-common/utils/decorators";
2015-07-08 16:45:13 -04:00
export default Ember.Component.extend({
2018-10-10 07:56:23 -04:00
classNameBindings: [":schema-table", "open"],
tagName: "li",
2015-07-08 16:45:13 -04:00
open: Ember.computed.reads("table.open"),
2015-07-08 16:45:13 -04:00
@on("didInsertElement")
_bindClicks() {
$(this.element)
2018-10-10 07:56:23 -04:00
.find(".schema-table-name")
2020-09-04 07:23:11 -04:00
.click((e) => {
this.set("table.open", !this.table.open);
2018-10-10 07:56:23 -04:00
e.preventDefault();
});
},
2015-07-09 18:46:19 -04:00
@on("willDestroyElement")
_cleanup() {
2020-09-04 07:23:11 -04:00
$(this.element).find(".schema-table-name").off("click");
},
2015-07-08 16:45:13 -04:00
});