Skip to content

Commit

Permalink
fix: click req-item children is not active
Browse files Browse the repository at this point in the history
  • Loading branch information
zy445566 committed Jan 18, 2021
1 parent 8631a27 commit 973a8af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "before-server",
"version": "1.0.69",
"version": "1.0.70",
"description": "before server for query client request",
"main": "index.js",
"scripts": {
Expand Down
9 changes: 5 additions & 4 deletions ui/src/pages/myMonitor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ export default class myMonitor extends HTMLContent {
badge = `<span class="badge badge-pill badge-danger">${data.res.statusCode}</span>`
}
reqItemTemplateContent.querySelector(".req-item").innerHTML = badge + completeUrl.pathname;
reqItemTemplateContent.querySelector(".req-item").addEventListener('click',(event)=>{
const that = this;
reqItemTemplateContent.querySelector(".req-item").addEventListener('click',function (_event){
for(const e of reqListDom.children) {e.className = e.className.replace('active','')}
if(event.target.className.indexOf('active')==-1) {
event.target.className += ' active'
if(this.className.indexOf('active')==-1) {
this.className += ' active'
}
this.showBody(data);
that.showBody(data);
})
reqListDom.appendChild(reqItemTemplateContent)
})
Expand Down

0 comments on commit 973a8af

Please sign in to comment.