How to use the @lrnwebcomponents/utils/utils.js.getRange function in @lrnwebcomponents/utils

To help you get started, we’ve selected a few @lrnwebcomponents/utils 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 elmsln / lrnwebcomponents / elements / editable-outline / src / editable-outline.js View on Github external
getDeepSelection() {
    // try and obtain the selection from the nearest shadow
    // which would give us the selection object when running native ShadowDOM
    // with fallback support for the entire window which would imply Shady
    // native API
    if (this.shadowRoot.getSelection) {
      return this.shadowRoot.getSelection();
    }
    // ponyfill from google
    else if (getRange(this.__outlineNode.parentNode)) {
      return getRange(this.__outlineNode.parentNode);
    }
    // missed on both, hope the normal one will work
    return window.getSelection();
  }
  /**
github elmsln / lrnwebcomponents / elements / editable-outline / editable-outline.js View on Github external
getDeepSelection() {
    // try and obtain the selection from the nearest shadow
    // which would give us the selection object when running native ShadowDOM
    // with fallback support for the entire window which would imply Shady
    // native API
    if (this.shadowRoot.getSelection) {
      return this.shadowRoot.getSelection();
    }
    // ponyfill from google
    else if (getRange(this.__outlineNode.parentNode)) {
      return getRange(this.__outlineNode.parentNode);
    }
    // missed on both, hope the normal one will work
    return window.getSelection();
  }
  /**
github elmsln / lrnwebcomponents / elements / editable-outline / editable-outline.es6.js View on Github external
getDeepSelection() {
    // try and obtain the selection from the nearest shadow
    // which would give us the selection object when running native ShadowDOM
    // with fallback support for the entire window which would imply Shady
    // native API
    if (this.shadowRoot.getSelection) {
      return this.shadowRoot.getSelection();
    }
    // ponyfill from google
    else if (getRange(this.__outlineNode.parentNode)) {
      return getRange(this.__outlineNode.parentNode);
    }
    // missed on both, hope the normal one will work
    return window.getSelection();
  }
  /**
github elmsln / lrnwebcomponents / elements / editable-outline / src / editable-outline.js View on Github external
getDeepSelection() {
    // try and obtain the selection from the nearest shadow
    // which would give us the selection object when running native ShadowDOM
    // with fallback support for the entire window which would imply Shady
    // native API
    if (this.shadowRoot.getSelection) {
      return this.shadowRoot.getSelection();
    }
    // ponyfill from google
    else if (getRange(this.__outlineNode.parentNode)) {
      return getRange(this.__outlineNode.parentNode);
    }
    // missed on both, hope the normal one will work
    return window.getSelection();
  }
  /**
github elmsln / lrnwebcomponents / elements / editable-outline / editable-outline.es6.js View on Github external
getDeepSelection() {
    // try and obtain the selection from the nearest shadow
    // which would give us the selection object when running native ShadowDOM
    // with fallback support for the entire window which would imply Shady
    // native API
    if (this.shadowRoot.getSelection) {
      return this.shadowRoot.getSelection();
    }
    // ponyfill from google
    else if (getRange(this.__outlineNode.parentNode)) {
      return getRange(this.__outlineNode.parentNode);
    }
    // missed on both, hope the normal one will work
    return window.getSelection();
  }
  /**
github elmsln / lrnwebcomponents / elements / editable-outline / editable-outline.js View on Github external
getDeepSelection() {
    // try and obtain the selection from the nearest shadow
    // which would give us the selection object when running native ShadowDOM
    // with fallback support for the entire window which would imply Shady
    // native API
    if (this.shadowRoot.getSelection) {
      return this.shadowRoot.getSelection();
    }
    // ponyfill from google
    else if (getRange(this.__outlineNode.parentNode)) {
      return getRange(this.__outlineNode.parentNode);
    }
    // missed on both, hope the normal one will work
    return window.getSelection();
  }
  /**