Skip to content

Commit

Permalink
notification fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ra3orblade committed Apr 20, 2024
1 parent ec405ad commit b30c3f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/ts/component/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Footer extends React.Component<Props> {
element: '#button-help',
vertical: I.MenuDirection.Top,
horizontal: I.MenuDirection.Right,
offsetY: -4,
offsetY: () => -($('#notifications').height() + 4),
});
};

Expand Down
21 changes: 11 additions & 10 deletions src/ts/component/list/notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,15 @@ const ListNotification = observer(class ListNotification extends React.Component
const node = $(this.node);
const items = node.find('.notification');

let nh = 0;
let fh = 0;
let listHeight = 0;
let firstHeight = 0;
let height = 0;
let bottom = 0;

raf(() => {
window.setTimeout(() => {
items.each((i: number, item: any) => {
item = $(item);

item.css({
width: (this.isExpanded ? '100%' : `calc(100% - ${4 * i * 2}px)`),
right: (this.isExpanded ? 0 : 4 * i),
Expand All @@ -113,33 +114,33 @@ const ListNotification = observer(class ListNotification extends React.Component
const h = item.outerHeight();

if (i == 0) {
fh = h;
firstHeight = h;
};

if (!this.isExpanded) {
if (i > 0) {
bottom = fh + 4 * i - h;
bottom = firstHeight + 4 * i - h;
};
} else {
const o = i > 0 ? 8 : 0;

bottom += height + o;
nh += h + o;
listHeight += h + o;
};

item.css({ bottom });
height = h;
});

if (!this.isExpanded) {
nh = fh + 4 * (LIMIT - 1);
listHeight = firstHeight + 4 * items.length;
} else
if (items.length) {
nh += 38;
listHeight += 38;
};

node.css({ height: nh });
});
node.css({ height: listHeight });
}, 50);
};

});
Expand Down

0 comments on commit b30c3f4

Please sign in to comment.