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

26 lines
546 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")
.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() {
$(this.element)
2018-10-10 07:56:23 -04:00
.find(".schema-table-name")
.off("click");
}
2015-07-08 16:45:13 -04:00
});