Sha256: aeac04d9144a2aa07bfcd5b1b87eea7219abf895d62f67ccdde5516a8a8aa73f

Contents?: true

Size: 606 Bytes

Versions: 2

Compression:

Stored size: 606 Bytes

Contents

var TextRange, select_all;

TextRange = (target) => {
  return {
    select_all() { select_all(target); }
  };
};

export default TextRange;

select_all = (() => {
  if(window.getSelection) {
    return (target) => {
      var selection, range;

      selection = window.getSelection();
      selection.removeAllRanges();

      range = document.createRange();
      range.selectNodeContents(target);
      selection.addRange(range);
    };
  } else {
    return (target) => {
      var range = document.body.createTextRange();
      range.moveToElementText(target);
      range.select();
    };
  }
})();

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
docks_theme_api-1.0.3 source/utilities/text_range/text_range.js
docks_theme_api-1.0.2 source/utilities/text_range/text_range.js