not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
667 B

  1. // Popup component based on picoModal
  2. var Popup = {
  3. template: '<div/>',
  4. data: function() {
  5. return {
  6. modal: null,
  7. result: null
  8. }
  9. },
  10. methods: {
  11. show: function(options) {
  12. var vm = this;
  13. requirejs(['picoModal'], function(picoModal) {
  14. vm.modal = modal = picoModal(options)
  15. .afterShow(function(modal) {
  16. vm.$emit("after-show");
  17. })
  18. .afterClose(function(modal) {
  19. vm.$emit("after-close", vm.result);
  20. })
  21. .show();
  22. });
  23. },
  24. close: function(result) {
  25. if (this.modal) {
  26. this.result = result;
  27. this.modal.close();
  28. }
  29. },
  30. destroy: function() {
  31. if (this.modal) {
  32. this.modal.destroy();
  33. }
  34. }
  35. }
  36. }