MCPcopy
hub / github.com/yabwe/medium-editor / selectElementContents

Function selectElementContents

spec/helpers/util.js:214–227  ·  view source on GitHub ↗
(el, options)

Source from the content-addressed store, hash-verified

212}
213
214function selectElementContents(el, options) {
215 options = options || {};
216
217 var range = document.createRange(),
218 sel = window.getSelection();
219 range.selectNodeContents(el);
220
221 if (options.collapse) {
222 range.collapse(options.collapse === true);
223 }
224
225 sel.removeAllRanges();
226 sel.addRange(range);
227}
228
229function selectElementContentsAndFire(el, options) {
230 options = options || {};

Callers 11

core-api.spec.jsFile · 0.85
anchor.spec.jsFile · 0.85
fontname.spec.jsFile · 0.85
paste.spec.jsFile · 0.85
fontsize.spec.jsFile · 0.85
util.spec.jsFile · 0.85
toolbar.spec.jsFile · 0.85
selection.spec.jsFile · 0.85
content.spec.jsFile · 0.85
events.spec.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…