FIX: Improve topic link click handling
The way we were handling clicks were not always passing topic ids to the model. This should improve the flow and make it more consistent.
This commit is contained in:
parent
13ab415fb0
commit
80745b81c9
|
@ -13,16 +13,10 @@ export default Ember.Component.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
// need to handle clicks here since links are in a raw view
|
// need to handle clicks here since links are in a raw view
|
||||||
didRender() {
|
click(e) {
|
||||||
const topicLinks = this.element.getElementsByClassName(
|
if (e.target.className === "knowledge-explorer-topic-link") {
|
||||||
"knowledge-explorer-topic-link"
|
|
||||||
);
|
|
||||||
|
|
||||||
for (let i = 0, max = topicLinks.length; i < max; i++) {
|
|
||||||
topicLinks[i].addEventListener("click", e => {
|
|
||||||
const topicId = e.target.dataset.topicId;
|
const topicId = e.target.dataset.topicId;
|
||||||
this.selectTopic(topicId);
|
this.selectTopic(topicId);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue