1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update components

This commit is contained in:
Luke Pulverenti 2016-03-15 22:46:13 -04:00
parent 48d4b0c287
commit c389d502e0
9 changed files with 95 additions and 41 deletions

View file

@ -16,12 +16,12 @@
},
"devDependencies": {},
"ignore": [],
"version": "1.1.60",
"_release": "1.1.60",
"version": "1.1.61",
"_release": "1.1.61",
"_resolution": {
"type": "version",
"tag": "1.1.60",
"commit": "6b1287b7db17651fab4570e9c7c6cb8e8cdead53"
"tag": "1.1.61",
"commit": "8565fb2a1cb83dc5528e8e79f8f9bc9ef0b7cb7d"
},
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
"_target": "~1.1.5",

View file

@ -171,7 +171,7 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
}
var firstConnectionResult;
function start() {
function start(options) {
loading.show();
@ -185,8 +185,10 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
loading.hide();
options = options || {};
page({
click: true,
click: options.click || false,
hashbang: true,
enableHistory: enableHistory()
});

View file

@ -36,7 +36,7 @@
"tag": "v1.3.0",
"commit": "1662093611cda3fd29125cdab94a61d3d88093da"
},
"_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

@ -45,7 +45,7 @@
"tag": "v1.0.11",
"commit": "e3c1ab0c72905b58fb4d9adc2921ea73b5c085a5"
},
"_source": "git://github.com/PolymerElements/paper-behaviors.git",
"_source": "git://github.com/polymerelements/paper-behaviors.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-behaviors"
"_originalSource": "polymerelements/paper-behaviors"
}

View file

@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
"version": "1.0.8",
"version": "1.0.9",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"
@ -35,11 +35,11 @@
},
"main": "paper-drawer-panel.html",
"ignore": [],
"_release": "1.0.8",
"_release": "1.0.9",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "673bc580a88a5cabbb612f29685cf21efac74c5b"
"tag": "v1.0.9",
"commit": "d0f2c801380397e5d4334b273a2fef63099d4a2f"
},
"_source": "git://github.com/PolymerElements/paper-drawer-panel.git",
"_target": "~1.0.2",

View file

@ -1,6 +1,6 @@
{
"name": "paper-drawer-panel",
"version": "1.0.8",
"version": "1.0.9",
"description": "A responsive drawer panel",
"authors": [
"The Polymer Authors"

View file

@ -479,6 +479,8 @@ Custom property | Description | Default
/**
* The panel that is being selected. `drawer` for the drawer panel and
* `main` for the main panel.
*
* @type {string|null}
*/
selected: {
reflectToAttribute: true,
@ -500,6 +502,9 @@ Custom property | Description | Default
* The CSS selector for the element that should receive focus when the drawer is open.
* By default, when the drawer opens, it focuses the first tabbable element. That is,
* the first element that can receive focus.
*
* To disable this behavior, you can set `drawerFocusSelector` to `null` or an empty string.
*
*/
drawerFocusSelector: {
type: String,
@ -586,8 +591,8 @@ Custom property | Description | Default
this.notifyResize();
}
if (e.propertyName === 'transform' && this.selected === 'drawer') {
//var focusedChild = this._getAutoFocusedNode();
//focusedChild && focusedChild.focus();
var focusedChild = this._getAutoFocusedNode();
focusedChild && focusedChild.focus();
}
},
@ -756,12 +761,6 @@ Custom property | Description | Default
}
this._setPeeking(false);
}
var dy = event.detail.dy;
var absDy = Math.abs(dy);
if (absDy >= 70) {
// Ignore trackx until we move past the edge peek.
return;
}
this._moveDrawer(this._translateXForDeltaX(dx));
}
@ -776,13 +775,10 @@ Custom property | Description | Default
sharedPanel = null;
this._moveDrawer(null);
var dx = event.detail.dx;
var dy = event.detail.dy;
var absDy = Math.abs(dy);
if (this.rightDrawer) {
this[xDirection ? 'closeDrawer' : 'openDrawer']();
} else {
this[xDirection || dx > -80 || absDy >= 70 ? 'openDrawer' : 'closeDrawer']();
this[xDirection ? 'openDrawer' : 'closeDrawer']();
}
}
},
@ -805,29 +801,33 @@ Custom property | Description | Default
_getAutoFocusedNode: function() {
var drawerContent = this._getDrawerContent();
return Polymer.dom(drawerContent).querySelector(this.drawerFocusSelector) || drawerContent;
return this.drawerFocusSelector ?
Polymer.dom(drawerContent).querySelector(this.drawerFocusSelector) || drawerContent : null;
},
_toggleFocusListener: function(selected) {
if (selected === 'drawer') {
document.addEventListener('focus', this._boundFocusListener, true);
this.addEventListener('focus', this._boundFocusListener, true);
} else {
document.removeEventListener('focus', this._boundFocusListener, true);
this.removeEventListener('focus', this._boundFocusListener, true);
}
},
_didFocus: function(event) {
var autoFocusedNode = this._getAutoFocusedNode();
if (!autoFocusedNode) {
return;
}
var path = Polymer.dom(event).path;
var focusedChild = path[0];
var drawerContent = this._getDrawerContent();
var focusedChildCameFromDrawer = false;
var autoFocusedNode = this._getAutoFocusedNode();
var focusedChildCameFromDrawer = path.indexOf(drawerContent) !== -1;
while (!focusedChildCameFromDrawer && path[0] && path[0].hasAttribute) {
focusedChildCameFromDrawer = path.shift() === drawerContent;
}
if (!focusedChildCameFromDrawer && autoFocusedNode) {
//autoFocusedNode.focus();
if (!focusedChildCameFromDrawer) {
event.stopPropagation();
autoFocusedNode.focus();
}
},

View file

@ -48,6 +48,25 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</template>
</test-fixture>
<test-fixture id="nestedDrawer">
<template>
<paper-drawer-panel force-narrow>
<div drawer>
<input id="innerLink1" tabindex="0" value="inside drawer 1">
</div>
<paper-drawer-panel id="drawer2" main force-narrow>
<div drawer>
<input id="innerLink2" tabindex="0" value="inside drawer 2">
</div>
<div main>
<input id="outerLink" tabindex="0" value="outside drawer">
</div>
</paper-drawer-panel>
</paper-drawer-panel>
</template>
</test-fixture>
<script>
function ensureDocumentHasFocus() {
window.top && window.top.focus();
@ -73,6 +92,39 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
});
suite('nested drawers', function() {
var drawer1, drawer2, innerLink1, innerLink2;
setup(function() {
drawer1 = fixture('nestedDrawer');
drawer2 = drawer1.querySelector('#drawer2');
innerLink1 = drawer1.querySelector('#innerLink1');
innerLink2 = drawer1.querySelector('#innerLink2');
ensureDocumentHasFocus();
});
test('should not cause stack overflow', function(done) {
var count = 0;
var spy = sinon.spy();
drawer1.openDrawer();
drawer2.openDrawer();
document.addEventListener('focus', spy, true);
MockInteractions.focus(innerLink1);
MockInteractions.focus(innerLink2);
Polymer.Base.async(function() {
if (spy.callCount > 10) {
throw new Error('stack overflow');
}
done();
}, 100);
});
});
</script>
</body>
</html>

View file

@ -32,14 +32,14 @@
"iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0"
},
"ignore": [],
"homepage": "https://github.com/PolymerElements/paper-ripple",
"homepage": "https://github.com/polymerelements/paper-ripple",
"_release": "1.0.5",
"_resolution": {
"type": "version",
"tag": "v1.0.5",
"commit": "d72e7a9a8ab518b901ed18dde492df3b87a93be5"
},
"_source": "git://github.com/PolymerElements/paper-ripple.git",
"_source": "git://github.com/polymerelements/paper-ripple.git",
"_target": "^1.0.0",
"_originalSource": "PolymerElements/paper-ripple"
"_originalSource": "polymerelements/paper-ripple"
}