Commit 72043b28 authored by Thiemo's avatar Thiemo

auto reload webpack serve

parent 1512a7b0
......@@ -131,4 +131,31 @@ export function generateHtmltree () {
// append <div class="divider"></div>
document.body.appendChild(main)
document.body.appendChild(footer)
// reset button must be last defined
let resetButtonDiv = document.createElement('div')
resetButtonDiv.classList.add('options-element', 'resetIcon', 'tooltip', 'tooltip-bottom', 'hand')
resetButtonDiv.setAttribute('data-tooltip', 'Reset')
resetButtonDiv.addEventListener('click', () => {
const content = document.getElementById('modal-content')
const footer = document.getElementById('modal-footer')
while (content.hasChildNodes()) {
content.removeChild(content.lastChild)
}
while (footer.hasChildNodes()) {
footer.removeChild(footer.lastChild)
}
content.appendChild(document.createTextNode('Alles löschen?'))
const doButton = document.createElement('div')
doButton.classList.add('modal-buttons', 'acceptIcon', 'hand')
doButton.addEventListener('click', () => presenter.resetModel())
footer.appendChild(doButton)
const cancelButton = document.createElement('div')
cancelButton.classList.add('modal-buttons', 'deleteIcon', 'hand')
cancelButton.addEventListener('click', () => document.getElementById('IEModal').classList.remove('active'))
footer.appendChild(cancelButton)
document.getElementById('IEModal').classList.add('active')
})
document.getElementById('optionButtons').appendChild(resetButtonDiv)
}
......@@ -41,32 +41,5 @@ window.onload = function () {
const importExport = new ImportExport(presenter, document.getElementById('Export'))
presenter.addView(importExport)
// reset button must be last defined
let resetButtonDiv = document.createElement('div')
resetButtonDiv.classList.add('options-element', 'resetIcon', 'tooltip', 'tooltip-bottom', 'hand')
resetButtonDiv.setAttribute('data-tooltip', 'Reset')
resetButtonDiv.addEventListener('click', () => {
const content = document.getElementById('modal-content')
const footer = document.getElementById('modal-footer')
while (content.hasChildNodes()) {
content.removeChild(content.lastChild)
}
while (footer.hasChildNodes()) {
footer.removeChild(footer.lastChild)
}
content.appendChild(document.createTextNode('Alles löschen?'))
const doButton = document.createElement('div')
doButton.classList.add('modal-buttons', 'acceptIcon', 'hand')
doButton.addEventListener('click', () => presenter.resetModel())
footer.appendChild(doButton)
const cancelButton = document.createElement('div')
cancelButton.classList.add('modal-buttons', 'deleteIcon', 'hand')
cancelButton.addEventListener('click', () => document.getElementById('IEModal').classList.remove('active'))
footer.appendChild(cancelButton)
document.getElementById('IEModal').classList.add('active')
})
document.getElementById('optionButtons').appendChild(resetButtonDiv)
presenter.init()
}
......@@ -69,7 +69,14 @@ var config = {
title: 'Struktogramm',
meta: { viewport: 'width=device-width, initial-scale=1, user-scalable=no' }
})
]
],
devServer: {
port: 8080,
contentBase: './src',
watchOptions: {
poll: true
}
}
}
module.exports = (env, argv) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment