source: trip-planner-front/node_modules/parse5/lib/extensions/location-info/open-element-stack-mixin.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 838 bytes
Line 
1'use strict';
2
3const Mixin = require('../../utils/mixin');
4
5class LocationInfoOpenElementStackMixin extends Mixin {
6 constructor(stack, opts) {
7 super(stack);
8
9 this.onItemPop = opts.onItemPop;
10 }
11
12 _getOverriddenMethods(mxn, orig) {
13 return {
14 pop() {
15 mxn.onItemPop(this.current);
16 orig.pop.call(this);
17 },
18
19 popAllUpToHtmlElement() {
20 for (let i = this.stackTop; i > 0; i--) {
21 mxn.onItemPop(this.items[i]);
22 }
23
24 orig.popAllUpToHtmlElement.call(this);
25 },
26
27 remove(element) {
28 mxn.onItemPop(this.current);
29 orig.remove.call(this, element);
30 }
31 };
32 }
33}
34
35module.exports = LocationInfoOpenElementStackMixin;
Note: See TracBrowser for help on using the repository browser.