progress-bars.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/uikit/progress-bars", ["jquery", "Site"], factory);
  4. } else if (typeof exports !== "undefined") {
  5. factory(require("jquery"), require("Site"));
  6. } else {
  7. var mod = {
  8. exports: {}
  9. };
  10. factory(global.jQuery, global.Site);
  11. global.uikitProgressBars = mod.exports;
  12. }
  13. })(this, function (_jquery, _Site) {
  14. "use strict";
  15. _jquery = babelHelpers.interopRequireDefault(_jquery);
  16. (0, _jquery.default)(document).ready(function ($$$1) {
  17. (0, _Site.run)();
  18. }); // Example Progress Animation
  19. // --------------------------
  20. (function () {
  21. (0, _jquery.default)('#exampleButtonStart').on('click', function () {
  22. (0, _jquery.default)('[data-plugin="progress"]').asProgress('start');
  23. });
  24. (0, _jquery.default)('#exampleButtonFinish').on('click', function () {
  25. (0, _jquery.default)('[data-plugin="progress"]').asProgress('finish');
  26. });
  27. (0, _jquery.default)('#exampleButtonGoto').on('click', function () {
  28. (0, _jquery.default)('[data-plugin="progress"]').asProgress('go', 50);
  29. });
  30. (0, _jquery.default)('#exampleButtonGotoPercentage').on('click', function () {
  31. (0, _jquery.default)('[data-plugin="progress"]').asProgress('go', '50%');
  32. });
  33. (0, _jquery.default)('#exampleButtonStop').on('click', function () {
  34. (0, _jquery.default)('[data-plugin="progress"]').asProgress('stop');
  35. });
  36. (0, _jquery.default)('#exampleButtonReset').on('click', function () {
  37. (0, _jquery.default)('[data-plugin="progress"]').asProgress('reset');
  38. });
  39. (0, _jquery.default)('#exampleButtonRandom').on('click', function (e) {
  40. e.preventDefault();
  41. (0, _jquery.default)('[data-plugin="progress"]').each(function () {
  42. var number = Math.round(Math.random(1) * 100) + '%';
  43. (0, _jquery.default)(this).asProgress('go', number);
  44. });
  45. });
  46. })();
  47. });