Skip to content

Commit

Permalink
add changelogs
Browse files Browse the repository at this point in the history
  • Loading branch information
Song Zheng committed Mar 8, 2020
1 parent cf79646 commit 1da433d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions public/changeLogs.js → src/changeLogs.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ const startLogDisplay = () => {
})
}

const logDisplay = document.querySelector('#logDisplay')
if (logDisplay) {
startLogDisplay()
const setupChangeLogs = () => {
const logDisplay = document.querySelector('#logDisplay')
if (logDisplay) {
startLogDisplay()
}
}

module.exports = {
setupChangeLogs
}
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* globals clientPath */
const { setupChangeLogs } = require('./changeLogs')

const setupHome = require('./home')
const setupNew = require('./new')
Expand All @@ -16,7 +17,8 @@ const startApp = () => {
return setupEdit()
}
if (clientPath === 'view') {
return setupView()
setupView()
return setupChangeLogs()
}
}
startApp()
3 changes: 3 additions & 0 deletions views/notes.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const clientStr = '<%- data.content %>'
const clientPath = '<%- data.path %>'
</script>
<pre id="rawData"><%- data.rawData -%></pre>

<div id="logDisplay"></div>

<script src="/main.js"></script>

<%- include('./layout/footer.ejs') %>

0 comments on commit 1da433d

Please sign in to comment.