From f01e27a00b9931b28ff8184751dedbe64db79ea2 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 4 Jan 2021 00:29:54 +0300 Subject: update --- app/static/app.js | 2 +- app/static/autocomplete.js | 16 ++++------------ app/static/style.css | 17 ----------------- app/templates/base.html | 2 -- server.py | 2 +- 5 files changed, 6 insertions(+), 33 deletions(-) diff --git a/app/static/app.js b/app/static/app.js index bc4b89e..faff329 100644 --- a/app/static/app.js +++ b/app/static/app.js @@ -141,7 +141,7 @@ class Maps { let html = `${pharmacyName}
`; html += `${pharmacyAddress}
`; html += `тел: ${pharmacyPhone}

`; - html += lines.join('\n'); + html += lines.join('
'); mark.properties.set('balloonContent', html); }); this.map.geoObjects.add(mark); diff --git a/app/static/autocomplete.js b/app/static/autocomplete.js index 87b42a5..c336123 100644 --- a/app/static/autocomplete.js +++ b/app/static/autocomplete.js @@ -25,10 +25,8 @@ class Autocomplete { field.addEventListener('click', (e) => { if (this.createItems() === 0) { - // prevent show empty e.stopPropagation(); this.dropdown.hide(); - // field.dropdown('hide'); } }); @@ -51,13 +49,10 @@ class Autocomplete { } renderIfNeeded() { - if (this.createItems() > 0) { + if (this.createItems() > 0) this.dropdown.show(); - // field.dropdown('show'); - } else { - // sets up positioning + else this.field.click(); - } } createItem(lookup, item) { @@ -69,9 +64,8 @@ class Autocomplete { label = item.label.substring(0, idx) + `${item.label.substring(idx, idx + lookup.length)}` + item.label.substring(idx + lookup.length, item.label.length); - } else { + } else label = item.label; - } return ce(``); } @@ -79,7 +73,6 @@ class Autocomplete { const lookup = this.field.value; if (lookup.length < this.options.treshold) { this.dropdown.hide(); - // field.dropdown('hide'); return 0; } @@ -101,12 +94,11 @@ class Autocomplete { item.addEventListener('click', (e) => { let dataValue = e.target.getAttribute('data-value'); this.field.value = e.target.innerText; - if (this.options.onSelectItem) { + if (this.options.onSelectItem) this.options.onSelectItem({ value: e.target.value, label: e.target.innerText, }); - } this.dropdown.hide(); }) }); diff --git a/app/static/style.css b/app/static/style.css index 303ffdc..e69de29 100644 --- a/app/static/style.css +++ b/app/static/style.css @@ -1,17 +0,0 @@ -/*.acme-container {*/ -/* margin-top: 1.5rem;*/ -/*}*/ - -#test { - position: absolute; - color: #fff; - background-color: red; - opacity: 0.25; - top: 0; - right: 0; - padding: 5px 8px; - cursor: pointer; -} -#test:hover { - opacity: 1; -} \ No newline at end of file diff --git a/app/templates/base.html b/app/templates/base.html index aeb42c6..8bc8cc7 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -5,7 +5,6 @@ - @@ -34,6 +33,5 @@ -
test
\ No newline at end of file diff --git a/server.py b/server.py index a243faa..e5e3347 100644 --- a/server.py +++ b/server.py @@ -4,4 +4,4 @@ from app import create_app, socketio app = create_app() if __name__ == '__main__': - socketio.run(app) + socketio.run(app, host='0.0.0.0') -- cgit v1.2.3