table_responsive.js 971 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* ------------------------------------------------------------------------------
  2. *
  3. * # Responsive tables
  4. *
  5. * Demo JS code for table_responsive.html page
  6. *
  7. * ---------------------------------------------------------------------------- */
  8. // Setup module
  9. // ------------------------------
  10. var TableFootable = function() {
  11. //
  12. // Setup module components
  13. //
  14. // Default file input style
  15. var _componentFootable = function() {
  16. if (!$().footable) {
  17. console.warn('Warning - footable.min.js is not loaded.');
  18. return;
  19. }
  20. // Initialize responsive functionality
  21. $('.table-togglable').footable();
  22. };
  23. //
  24. // Return objects assigned to module
  25. //
  26. return {
  27. init: function() {
  28. _componentFootable();
  29. }
  30. }
  31. }();
  32. // Initialize module
  33. // ------------------------------
  34. document.addEventListener('DOMContentLoaded', function() {
  35. TableFootable.init();
  36. });