How to use the global/document.documentElement function in global

To help you get started, we’ve selected a few global 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 cristipufu / SwiftClient / samples / SwiftClient.Demo / wwwroot / lib / video-js / src / js / player.js View on Github external
exitFullWindow() {
    this.isFullWindow = false;
    Events.off(document, 'keydown', this.fullWindowOnEscKey);

    // Unhide scroll bars.
    document.documentElement.style.overflow = this.docOrigOverflow;

    // Remove fullscreen styles
    Dom.removeElClass(document.body, 'vjs-full-window');

    // Resize the box, controller, and poster to original sizes
    // this.positionAll();
    this.trigger('exitFullWindow');
  }
github mediaelement / mediaelement / src / js / features / fullscreen.js View on Github external
;

		if (!t.isVideo) {
			return;
		}

		// Prevent container from attempting to stretch a second time
		clearTimeout(t.containerSizeTimeout);

		// come out of native fullscreen
		if (Features.HAS_TRUE_NATIVE_FULLSCREEN && (Features.IS_FULLSCREEN || t.isFullScreen)) {
			Features.cancelFullScreen();
		}

		// restore scroll bars to document
		removeClass(document.documentElement, `${t.options.classPrefix}fullscreen`);
		removeClass(t.getElement(t.container), `${t.options.classPrefix}container-fullscreen`);

		if (t.options.setDimensions) {
			t.getElement(t.container).style.width = `${t.normalWidth}px`;
			t.getElement(t.container).style.height = `${t.normalHeight}px`;

			if (isNative) {
				t.node.style.width = `${t.normalWidth}px`;
				t.node.style.height = `${t.normalHeight}px`;
			} else {
				const elements = t.getElement(t.container).querySelectorAll('embed, object, video'), total = elements.length;
				for (let i = 0; i < total; i++) {
					elements[i].style.width = `${t.normalWidth}px`;
					elements[i].style.height = `${t.normalHeight}px`;
				}
			}
github dblate / larkplayer / src / utils / dom.js View on Github external
export function findPosition(el) {
    let box = getBoundingClientRect(el);

    if (!box) {
        return {left: 0, top: 0};
    }

    const docEl = document.documentElement;
    const body = document.body;

    const clientLeft = docEl.clientLeft || body.clientLeft || 0;
    const scrollLeft = window.pageXOffset || body.scrollLeft;
    const left = box.left + scrollLeft - clientLeft;

    const clientTop = docEl.clientLeft || body.clientLeft || 0;
    const scrollTop = window.pageYOffset || body.scrollTop;
    const top = box.top + scrollTop - clientTop;

    // 安卓有时侯返回小数,稍微有点偏差,这里四舍五入下
    return {
        left: Math.round(left),
        top: Math.round(top)
    };
}
github WhiteBlue / bilibili-html5 / static / components / video.js / src / js / player.js View on Github external
exitFullWindow() {
    this.isFullWindow = false;
    Events.off(document, 'keydown', this.fullWindowOnEscKey);

    // Unhide scroll bars.
    document.documentElement.style.overflow = this.docOrigOverflow;

    // Remove fullscreen styles
    Dom.removeElClass(document.body, 'vjs-full-window');

    // Resize the box, controller, and poster to original sizes
    // this.positionAll();
    this.trigger('exitFullWindow');
  }
github Raynos / mercury / examples / todomvc / index.html View on Github external
function DOMDelegator() {
    this.target = document.documentElement
    this.events = {}
}
github Raynos / mercury / examples / 2048 / index.html View on Github external
function DOMDelegator() {
    this.target = document.documentElement
    this.events = {}
}
github mediaelement / mediaelement / src / js / utils / constants.js View on Github external
export const SUPPORT_POINTER_EVENTS = (() => {
	const
		element = document.createElement('x'),
		documentElement = document.documentElement,
		getComputedStyle = window.getComputedStyle
	;

	if (!('pointerEvents' in element.style)) {
		return false;
	}

	element.style.pointerEvents = 'auto';
	element.style.pointerEvents = 'x';
	documentElement.appendChild(element);
	let supports = getComputedStyle && (getComputedStyle(element, '') || {}).pointerEvents === 'auto';
	element.remove();
	return !!supports;
})();
github wayfair / tungstenjs / src / event / handlers / window_events.js View on Github external
var getScrollData = function() {
  var doc = document.documentElement;
  return {
    x: (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0),
    y: (window.pageYOffset || doc.scrollTop)  - (doc.clientTop || 0)
  };
};
github Raynos / graphics / mouse.js View on Github external
function getXY(event) {
    var posx = 0
    var posy = 0

    if (!event) {
        event = window.event
    }

    if (event.pageX || event.pageY) {
        posx = event.pageX;
        posy = event.pageY;
    } else if (event.clientX || event.clientY)  {
        posx = event.clientX + document.body.scrollLeft +
            document.documentElement.scrollLeft;
        posy = event.clientY + document.body.scrollTop +
            document.documentElement.scrollTop;
    }

    return new Point(posx, posy)
}
github lukeburns / morphable / bundle.js View on Github external
function beginObserve(observer) {
      observer.observe(document.documentElement, {
        childList: true,
        subtree: true,
        attributes: true,
        attributeOldValue: true,
        attributeFilter: [KEY_ATTR]
      });
    }