From c782dadb95cc2e50cf7fa7fd7c990804cbb5708c Mon Sep 17 00:00:00 2001 From: brandonocasey Date: Mon, 11 Mar 2019 17:37:16 -0400 Subject: [PATCH] ignore: add several debugging aides --- src/js/mixins/evented.js | 1 + src/js/utils/dom-data.js | 2 +- src/js/utils/fn.js | 7 +++++++ src/js/video.js | 3 +++ 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/js/mixins/evented.js b/src/js/mixins/evented.js index 95a91d1066..72e0ce4104 100644 --- a/src/js/mixins/evented.js +++ b/src/js/mixins/evented.js @@ -280,6 +280,7 @@ const EventedMixin = { // Use the same function ID as the listener so we can remove it later // it using the ID of the original listener. wrapper.guid = listener.guid; + wrapper.original_ = listener.original_ || listener; listen(target, 'one', type, wrapper); } }, diff --git a/src/js/utils/dom-data.js b/src/js/utils/dom-data.js index 753044a1b4..71ad4180f8 100644 --- a/src/js/utils/dom-data.js +++ b/src/js/utils/dom-data.js @@ -14,7 +14,7 @@ import * as Guid from './guid.js'; * @type {Object} * @private */ -const elData = {}; +export const elData = {}; /* * Unique attribute name to store an element's guid in diff --git a/src/js/utils/fn.js b/src/js/utils/fn.js index 151958febb..df2622234b 100644 --- a/src/js/utils/fn.js +++ b/src/js/utils/fn.js @@ -44,6 +44,9 @@ export const bind = function(context, fn, uid) { // currently used in text tracks bound.guid = (uid) ? uid + '_' + fn.guid : fn.guid; + bound.original_ = fn.original_ || fn; + bound.context_ = fn.context_ || context; + return bound; }; @@ -72,6 +75,8 @@ export const throttle = function(fn, wait) { } }; + throttled.original_ = fn.original_ || fn; + return throttled; }; @@ -133,5 +138,7 @@ export const debounce = function(func, wait, immediate, context = window) { debounced.cancel = cancel; + debounced.original_ = func.original_ || func; + return debounced; }; diff --git a/src/js/video.js b/src/js/video.js index d1a7abfc44..bb61934f04 100644 --- a/src/js/video.js +++ b/src/js/video.js @@ -22,6 +22,7 @@ import { createTimeRanges } from './utils/time-ranges.js'; import formatTime, { setFormatTime, resetFormatTime } from './utils/format-time.js'; import log, { createLogger } from './utils/log.js'; import * as Dom from './utils/dom.js'; +import * as DomData from './utils/dom-data.js'; import * as browser from './utils/browser.js'; import * as Url from './utils/url.js'; import {isObject} from './utils/obj'; @@ -553,6 +554,8 @@ videojs.computedStyle = computedStyle; */ videojs.dom = Dom; +videojs.domData = DomData; + /** * A reference to the {@link module:url|URL utility module} as an object. *