diff --git a/src/web/app/desktop/tags/donation.tag b/src/web/app/desktop/tags/donation.tag index 0946e430da..57b36a3054 100644 --- a/src/web/app/desktop/tags/donation.tag +++ b/src/web/app/desktop/tags/donation.tag @@ -50,7 +50,7 @@ this.mixin('api'); this.mixin('i'); - this.close = (e) => { + this.close = e => { e.preventDefault(); e.stopPropagation(); @@ -61,7 +61,6 @@ no_donation: this.I.data.no_donation this.unmount(); - - this.parent.parent.set-root-layout! + }; </script> </mk-donation> diff --git a/src/web/app/desktop/tags/ui-header.tag b/src/web/app/desktop/tags/ui-header.tag index 05d1ff6655..9dd1ace6b9 100644 --- a/src/web/app/desktop/tags/ui-header.tag +++ b/src/web/app/desktop/tags/ui-header.tag @@ -21,7 +21,7 @@ <style> :scope display block - position fixed + position sticky top 0 z-index 1024 width 100% diff --git a/src/web/app/desktop/tags/ui.tag b/src/web/app/desktop/tags/ui.tag index 1e2cba35be..e6781f4a2d 100644 --- a/src/web/app/desktop/tags/ui.tag +++ b/src/web/app/desktop/tags/ui.tag @@ -9,29 +9,28 @@ <style> :scope display block - </style> <script> this.mixin('i'); - this.open-post-form = () => { - riot.mount document.body.appendChild document.createElement 'mk-post-form-window' - - this.set-root-layout = () => { - this.root.style.padding-top = this.refs.header.root.client-height + 'px' + this.openPostForm = () => { + riot.mount(document.body.appendChild(document.createElement('mk-post-form-window'); + }; this.on('mount', () => { - @set-root-layout! - document.addEventListener 'keydown' this.onkeydown + document.addEventListener('keydown', this.onkeydown); + }); this.on('unmount', () => { - document.removeEventListener 'keydown' this.onkeydown + document.removeEventListener('keydown', this.onkeydown); + }); - this.onkeydown = (e) => { - tag = e.target.tag-name.to-lower-case! - if tag != 'input' and tag != 'textarea' - if e.which == 80 or e.which == 78 // p or n - e.preventDefault(); - @open-post-form! + this.onkeydown = e => { + if (e.target.tagName == 'input' || e.target.tagName == 'textarea') return; + + if (e.which == 80 || e.which == 78) { // p or n + e.preventDefault(); + this.openPostForm(); + }; </script> </mk-ui>