Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

34 righe
646 B

  1. define([
  2. 'js/system/events'
  3. ], function (
  4. events
  5. ) {
  6. return {
  7. type: 'events',
  8. list: [],
  9. init: function () {
  10. this.list.forEach(function (q) {
  11. events.emit('onObtainEvent', q);
  12. });
  13. },
  14. extend: function (blueprint) {
  15. if (blueprint.updateList) {
  16. blueprint.updateList.forEach(function (q) {
  17. events.emit('onObtainEvent', q);
  18. this.list.spliceWhere(l => l.id === q.id);
  19. this.list.push(q);
  20. }, this);
  21. }
  22. if (blueprint.removeList) {
  23. blueprint.removeList.forEach(function (q) {
  24. events.emit('onRemoveEvent', q.id);
  25. this.list.spliceWhere(l => l.id === q.id);
  26. }, this);
  27. }
  28. }
  29. };
  30. });