update components

This commit is contained in:
Luke Pulverenti 2016-02-29 11:23:30 -05:00
parent 7b40f1daff
commit 9b6a17e0a0
8 changed files with 126 additions and 10 deletions

View File

@ -15,12 +15,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.6",
"_release": "1.1.6",
"version": "1.1.10",
"_release": "1.1.10",
"_resolution": {
"type": "version",
"tag": "1.1.6",
"commit": "155d278afe013c0ad06f64616c9b23680cbc545c"
"tag": "1.1.10",
"commit": "80b28a8a69cb1ff8269b1443b7982be7c0c5bc8a"
},
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.1.5",

View File

@ -49,6 +49,13 @@
return pos;
}
function addCenterFocus(dlg) {
require(['scrollHelper'], function (scrollHelper) {
scrollHelper.centerFocus.on(dlg.querySelector('.actionSheetScroller'), false);
});
}
function show(options) {
// items
@ -154,6 +161,10 @@
dlg.style.top = pos.top + 'px';
}
if (layoutManager.tv) {
addCenterFocus(dlg);
}
document.body.appendChild(dlg);
// Seeing an issue in some non-chrome browsers where this is requiring a double click

View File

@ -0,0 +1,102 @@
define(['focusManager'], function (focusManager) {
function getOffset(elem) {
var doc = document;
var box = { top: 0, left: 0 };
if (!doc) {
return box;
}
var docElem = doc.documentElement;
// Support: BlackBerry 5, iOS 3 (original iPhone)
// If we don't have gBCR, just use 0,0 rather than error
if (elem.getBoundingClientRect) {
box = elem.getBoundingClientRect();
}
var win = doc.defaultView;
return {
top: box.top + win.pageYOffset - docElem.clientTop,
left: box.left + win.pageXOffset - docElem.clientLeft
};
}
function getPosition(scrollContainer, item, horizontal) {
var slideeOffset = getOffset(scrollContainer);
var itemOffset = getOffset(item);
var offset = horizontal ? itemOffset.left - slideeOffset.left : itemOffset.top - slideeOffset.top;
var size = item[horizontal ? 'offsetWidth' : 'offsetHeight'];
if (horizontal) {
offset += scrollContainer.scrollLeft;
} else {
offset += scrollContainer.scrollTop;
}
var frameSize = horizontal ? scrollContainer.offsetWidth : scrollContainer.offsetHeight;
return {
start: offset,
center: (offset - (frameSize / 2) + (size / 2)),
end: offset - frameSize + size,
size: size
};
}
function toCenter(container, elem, horizontal) {
var pos = getPosition(container, elem, horizontal);
if (container.scrollTo) {
if (horizontal) {
container.scrollTo(pos.center, 0);
} else {
container.scrollTo(0, pos.center);
}
} else {
if (horizontal) {
container.scrollLeft = Math.round(pos.center);
} else {
container.scrollTop = Math.round(pos.center);
}
}
}
function centerOnFocus(e, scrollSlider, horizontal) {
var focused = focusManager.focusableParent(e.target);
if (focused) {
toCenter(scrollSlider, focused, horizontal);
}
}
function centerOnFocusHorizontal(e) {
centerOnFocus(e, this, true);
}
function centerOnFocusVertical(e) {
centerOnFocus(e, this, false);
}
return {
getPosition: getPosition,
centerFocus: {
on: function (element, horizontal) {
if (horizontal) {
element.addEventListener('focus', centerOnFocusHorizontal, true);
} else {
element.addEventListener('focus', centerOnFocusVertical, true);
}
},
off: function (element, horizontal) {
if (horizontal) {
element.removeEventListener('focus', centerOnFocusHorizontal, true);
} else {
element.removeEventListener('focus', centerOnFocusVertical, true);
}
}
},
toCenter: toCenter
};
});

View File

@ -31,14 +31,14 @@
"web-component-tester": "*",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
"homepage": "https://github.com/polymerelements/iron-icon",
"homepage": "https://github.com/PolymerElements/iron-icon",
"_release": "1.0.7",
"_resolution": {
"type": "version",
"tag": "v1.0.7",
"commit": "6f4d152dc3998a6cc12a5a585a654f893dc99381"
},
"_source": "git://github.com/polymerelements/iron-icon.git",
"_source": "git://github.com/PolymerElements/iron-icon.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-icon"
"_originalSource": "PolymerElements/iron-icon"
}

View File

@ -36,7 +36,7 @@
"tag": "v1.2.4",
"commit": "1ee4e2e11a9e5118320987d93fc2c03ae9a489f4"
},
"_source": "git://github.com/polymerelements/iron-selector.git",
"_source": "git://github.com/PolymerElements/iron-selector.git",
"_target": "^1.0.0",
"_originalSource": "polymerelements/iron-selector"
"_originalSource": "PolymerElements/iron-selector"
}

View File

@ -43,7 +43,7 @@
</a>
</div>
<div class="terms hide fieldDescription" style="margin-top: 2em; color: #ccc;"></div>
<div><br/><br/><iron-icon icon="new-releases" style="color: #52B54B"></iron-icon> Try the new <a href="//tv.emby.media" target="_blank">Emby Theater at tv.emby.media</a>, a remote-friendly app designed for your TV or large screen monitor.</div>
<div class="hide tvAppInfo"><br/><br/><iron-icon icon="new-releases" style="color: #52B54B"></iron-icon> Try the new <a href="//tv.emby.media" target="_blank">Emby Theater at tv.emby.media</a>, a remote-friendly app designed for your TV or large screen monitor.</div>
</form>
<form class="manualServerForm" style="margin: 0 auto;display:none;">

View File

@ -256,8 +256,10 @@
if (AppInfo.isNativeApp) {
terms.classList.add('hide');
page.querySelector('.tvAppInfo').classList.add('hide');
} else {
terms.classList.remove('hide');
page.querySelector('.tvAppInfo').classList.remove('hide');
}
}).on('pagebeforeshow', "#connectLoginPage", function () {

View File

@ -1901,6 +1901,7 @@ var AppInfo = {};
define("paperdialoghelper", [embyWebComponentsBowerPath + "/paperdialoghelper/paperdialoghelper"], returnFirstDependency);
define("loading", [embyWebComponentsBowerPath + "/loading/loading"], returnFirstDependency);
define("toast", [embyWebComponentsBowerPath + "/toast/toast"], returnFirstDependency);
define("scrollHelper", [embyWebComponentsBowerPath + "/scrollhelper"], returnFirstDependency);
// alias
define("historyManager", [], function () {