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.

35 lines
838 B

  1. 'use strict';
  2. const Mixin = require('../../utils/mixin');
  3. class LocationInfoOpenElementStackMixin extends Mixin {
  4. constructor(stack, opts) {
  5. super(stack);
  6. this.onItemPop = opts.onItemPop;
  7. }
  8. _getOverriddenMethods(mxn, orig) {
  9. return {
  10. pop() {
  11. mxn.onItemPop(this.current);
  12. orig.pop.call(this);
  13. },
  14. popAllUpToHtmlElement() {
  15. for (let i = this.stackTop; i > 0; i--) {
  16. mxn.onItemPop(this.items[i]);
  17. }
  18. orig.popAllUpToHtmlElement.call(this);
  19. },
  20. remove(element) {
  21. mxn.onItemPop(this.current);
  22. orig.remove.call(this, element);
  23. }
  24. };
  25. }
  26. }
  27. module.exports = LocationInfoOpenElementStackMixin;