Skip to content

Commit

Permalink
Nice scroller for top mail panel
Browse files Browse the repository at this point in the history
  • Loading branch information
yurabakhtin committed Jul 4, 2024
1 parent 3d0caac commit 7c0bb09
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions resources/js/humhub.mail.notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,29 @@ humhub.module('mail.notification', function (module, require, $) {
currentXhr.abort();
}

const messageLoader = $('#loader_messages');
const messageList = messageLoader.parent();

// remove all <li> entries from dropdown
$('#loader_messages').parent().find(':not(#loader_messages)').remove();
loader.set($('#loader_messages').show());
messageLoader.parent().find(':not(#loader_messages)').remove();
loader.set(messageLoader.show());

client.get(module.config.url.list, {
beforeSend: function (xhr) {
currentXhr = xhr;
}
}).then(function (response) {
currentXhr = undefined;
$('#loader_messages').parent().prepend($(response.html));
$('#loader_messages').hide();
messageList.prepend($(response.html));
messageLoader.hide();
messageList.niceScroll({
cursorwidth: '7',
cursorborder: '',
cursorcolor: '#555',
cursoropacitymax: '0.2',
nativeparentscrolling: false,
railpadding: {top: 0, right: 3, left: 0, bottom: 0}
});
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion resources/js/humhub.mail.notification.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7c0bb09

Please sign in to comment.