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

update translations

This commit is contained in:
Luke Pulverenti 2016-02-10 14:16:48 -05:00
parent 9e8e2dddad
commit 569aa605b4
93 changed files with 1443 additions and 319 deletions

View file

@ -72,7 +72,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var menu = fixture('basic');
MockInteractions.focus(menu);
setTimeout(function() {
assert.equal(document.activeElement, menu.firstElementChild, 'document.activeElement is first item')
var ownerRoot = Polymer.dom(menu.firstElementChild).getOwnerRoot() || document;
var activeElement = Polymer.dom(ownerRoot).activeElement;
assert.equal(activeElement, menu.firstElementChild, 'menu.firstElementChild is focused');
done();
// wait for async in _onFocus
}, 200);
@ -83,7 +85,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
menu.selected = 1;
MockInteractions.focus(menu);
setTimeout(function() {
assert.equal(document.activeElement, menu.selectedItem, 'document.activeElement is selected item');
var ownerRoot = Polymer.dom(menu.selectedItem).getOwnerRoot() || document;
var activeElement = Polymer.dom(ownerRoot).activeElement;
assert.equal(activeElement, menu.selectedItem, 'menu.selectedItem is focused');
done();
// wait for async in _onFocus
}, 200);
});
test('focusing non-item content does not auto-focus an item', function(done) {
var menu = fixture('basic');
menu.extraContent.focus();
setTimeout(function() {
var menuOwnerRoot = Polymer.dom(menu.extraContent).getOwnerRoot() || document;
var menuActiveElement = Polymer.dom(menuOwnerRoot).activeElement;
assert.equal(menuActiveElement, menu.extraContent, 'menu.extraContent is focused');
assert.equal(Polymer.dom(document).activeElement, menu, 'menu is document.activeElement');
done();
// wait for async in _onFocus
}, 200);
@ -94,7 +111,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
menu.selected = 0;
menu.items[1].click();
setTimeout(function() {
assert.equal(document.activeElement, menu.items[1], 'document.activeElement is last activated item');
var ownerRoot = Polymer.dom(menu.items[1]).getOwnerRoot() || document;
var activeElement = Polymer.dom(ownerRoot).activeElement;
assert.equal(activeElement, menu.items[1], 'menu.items[1] is focused');
done();
// wait for async in _onFocus
}, 200);
@ -105,7 +124,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
menu.selected = 0;
menu.items[0].click();
setTimeout(function() {
assert.equal(document.activeElement, menu.items[0], 'document.activeElement is last activated item');
var ownerRoot = Polymer.dom(menu.items[0]).getOwnerRoot() || document;
var activeElement = Polymer.dom(ownerRoot).activeElement;
assert.equal(activeElement, menu.items[0], 'menu.items[0] is focused');
done();
// wait for async in _onFocus
}, 200);

View file

@ -87,6 +87,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}, 200);
});
test('focusing non-item content does not auto-focus an item', function(done) {
var menubar = fixture('basic');
menubar.extraContent.focus();
setTimeout(function() {
var ownerRoot = Polymer.dom(menubar.extraContent).getOwnerRoot() || document;
var activeElement = Polymer.dom(ownerRoot).activeElement;
assert.equal(activeElement, menubar.extraContent, 'menubar.extraContent is focused');
assert.equal(Polymer.dom(document).activeElement, menubar, 'menubar is document.activeElement');
done();
// wait for async in _onFocus
}, 200);
});
test('last activated item in a multi select menubar is focused', function(done) {
var menubar = fixture('multi');
menubar.selected = 0;

View file

@ -17,6 +17,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<content></content>
<div id="extraContent" tabindex="-1">focusable extra content</div>
</template>
</dom-module>
@ -31,7 +33,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
behaviors: [
Polymer.IronMenuBehavior
]
],
get extraContent() {
return this.$.extraContent;
}
});

View file

@ -17,6 +17,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<content></content>
<div id="extraContent" tabindex="-1">focusable extra content</div>
</template>
</dom-module>
@ -31,7 +33,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
behaviors: [
Polymer.IronMenubarBehavior
]
],
get extraContent() {
return this.$.extraContent;
}
});