move the notification clear button up

pull/9928/head
Thibault Duplessis 2021-10-03 13:34:31 +02:00
parent 5af50b8b8d
commit eb15e36b3c
2 changed files with 21 additions and 31 deletions

View File

@ -11,13 +11,13 @@
padding: 2rem 0;
}
.clear {
display: flex;
justify-content: flex-end;
button {
&:hover {
color: $c-bad;
}
.delete {
position: absolute;
top: 0;
right: 0;
padding: 0.5rem;
&:hover {
color: $c-bad;
}
}

View File

@ -17,32 +17,22 @@ function renderContent(ctrl: Ctrl, d: NotifyData): VNode[] {
const nodes: VNode[] = [];
if (pager.previousPage)
nodes.push(
h('div.pager.prev', {
attrs: { 'data-icon': '' },
hook: clickHook(ctrl.previousPage),
})
);
else if (pager.nextPage)
nodes.push(
h('div.pager.prev.disabled', {
attrs: { 'data-icon': '' },
})
);
nodes.push(
h(`div.pager.prev${pager.previousPage ? '' : '.disabled'}`, {
attrs: { 'data-icon': '' },
hook: clickHook(ctrl.previousPage),
})
);
if (nb > 0 && pager.currentPage == 1)
if (nb > 0)
nodes.push(
h(
'div.clear',
h('button.delete.button.button-empty', {
attrs: {
'data-icon': '',
title: 'Clear',
},
hook: clickHook(ctrl.clear),
})
)
h('button.delete.button.button-empty', {
attrs: {
'data-icon': '',
title: 'Clear',
},
hook: clickHook(ctrl.clear),
})
);
nodes.push(nb ? recentNotifications(d, ctrl.scrolling()) : empty());