How to use the ember-window-mock.pageYOffset function in ember-window-mock

To help you get started, we’ve selected a few ember-window-mock examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github peopleconnectus / ember-concurrency-scroll / addon / services / scroller.js View on Github external
};
    let end;
    // if we're targeting a container, account for offset to start and end
    if (options.container) {
      end = {
        y: element.offsetTop,
        x: element.offsetLeft
      };
      let container = this.getContainer(options.container);
      start.y = container.scrollTop;
      end.y = end.y - container.offsetTop;
      start.x = container.scrollLeft;
      end.x = end.x - container.offsetLeft;
    } else {
      end = {
        y: window.pageYOffset + element.getBoundingClientRect().top,
        x: window.pageXOffset + element.getBoundingClientRect().left
      };
    }
    yield this.get('scrollToTask').perform(start, end, options);
  }),

ember-window-mock

Wraps the global window object with a proxy that can be mocked in tests

MIT
Latest version published 4 months ago

Package Health Score

74 / 100
Full package analysis