pie-progress.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. (function (global, factory) {
  2. if (typeof define === "function" && define.amd) {
  3. define("/charts/pie-progress", ["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.chartsPieProgress = 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 Api Methods
  19. // -------------------
  20. (function () {
  21. var $example = (0, _jquery.default)('#examplePieApi');
  22. (0, _jquery.default)('.pie-api-start').on('click', function () {
  23. $example.asPieProgress('start');
  24. });
  25. (0, _jquery.default)('.pie-api-finish').on('click', function () {
  26. $example.asPieProgress('finish');
  27. });
  28. (0, _jquery.default)('.pie-api-go').on('click', function () {
  29. $example.asPieProgress('go', 200);
  30. });
  31. (0, _jquery.default)('.pie-api-go_percentage').on('click', function () {
  32. $example.asPieProgress('go', '50%');
  33. });
  34. (0, _jquery.default)('.pie-api-stop').on('click', function () {
  35. $example.asPieProgress('stop');
  36. });
  37. (0, _jquery.default)('.pie-api-reset').on('click', function () {
  38. $example.asPieProgress('reset');
  39. });
  40. })();
  41. });