update emby input

This commit is contained in:
Luke Pulverenti 2016-05-29 15:41:39 -04:00
parent 21fbbc894a
commit ae55e83e30

View File

@ -53,6 +53,32 @@
this.addEventListener('keyup', onChange);
onChange.call(this);
if (window.IntersectionObserver) {
var observer = new IntersectionObserver(function (entries) {
for (var j = 0, length2 = entries.length; j < length2; j++) {
var entry = entries[j];
var intersectionRatio = entry.intersectionRatio;
if (intersectionRatio) {
var target = entry.target;
onChange.call(target);
}
}
}, {});
observer.observe(this);
this.observer = observer;
}
};
EmbyInputPrototype.detachedCallback = function () {
var observer = this.observer;
if (observer) {
observer.disconnect();
this.observer = null;
}
};
document.registerElement('emby-input', {