How to use the ember-user-activity/utils/window function in ember-user-activity

To help you get started, we’ve selected a few ember-user-activity 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 elwayman02 / ember-user-activity / addon / utils / get-scroll.js View on Github external
return;
  }

  if (elem.jquery) { // Convert to DOM element if jQuery was used
    elem = elem[0];
  }

  if (elem === null || elem === undefined) {
    return;
  }

  // `window`/`document` do not have scrollLeft attributes
  // Instead, we look at `pageXOffset`, which is an alias for `scrollX`,
  // But has better browser support (namely IE)
  // https://developer.mozilla.org/en-US/docs/Web/API/Window/pageXOffset
  let windowObj = getWindow(elem);
  if (windowObj) {
    if (direction === 'left') {
      return windowObj.pageXOffset;
    }
    return windowObj.pageYOffset;
  }

  if (direction === 'left') {
    return elem.scrollLeft;
  }

  return elem.scrollTop;
}

ember-user-activity

Ember Addon for tracking user activity & idling

MIT
Latest version published 9 months ago

Package Health Score

68 / 100
Full package analysis

Popular ember-user-activity functions