chat_layouts.js 997 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # Chat layouts
  4. *
  5. * Demo JS code for chat_layouts.html page
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Setup module
  9. // ------------------------------
  10. var ChatLayouts = function() {
  11. //
  12. // Setup module components
  13. //
  14. // Scroll to bottom of the chat on page load. Mainly for demo
  15. var _layoutChat = function() {
  16. $('.media-chat-scrollable').scrollTop($(this).height());
  17. };
  18. var _layoutChatHidden = function() {
  19. $('.nav-link[data-toggle="tab"]').on('shown.bs.tab', function (e) {
  20. _layoutChat();
  21. });
  22. };
  23. //
  24. // Return objects assigned to module
  25. //
  26. return {
  27. init: function() {
  28. _layoutChat();
  29. _layoutChatHidden();
  30. }
  31. }
  32. }();
  33. // Initialize module
  34. // ------------------------------
  35. document.addEventListener('DOMContentLoaded', function() {
  36. ChatLayouts.init();
  37. });