mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
25b5198fa7
commit
e5a4b3813f
21 changed files with 360 additions and 87 deletions
|
@ -453,6 +453,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(rect.height, elRect.height, 'no cropping');
|
||||
});
|
||||
|
||||
test('element margin is considered as offset', function() {
|
||||
el.verticalAlign = 'top';
|
||||
el.style.marginTop = '10px';
|
||||
el.refit();
|
||||
var rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.top, parentRect.top + 10, 'top ok');
|
||||
assert.equal(rect.height, elRect.height, 'no cropping');
|
||||
|
||||
el.style.marginTop = '-10px';
|
||||
el.refit();
|
||||
rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.top, parentRect.top - 10, 'top ok');
|
||||
assert.equal(rect.height, elRect.height, 'no cropping');
|
||||
});
|
||||
|
||||
test('verticalOffset is applied', function() {
|
||||
el.verticalAlign = 'top';
|
||||
el.verticalOffset = 10;
|
||||
|
@ -499,6 +514,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(rect.height, elRect.height, 'no cropping');
|
||||
});
|
||||
|
||||
test('element margin is considered as offset', function() {
|
||||
el.verticalAlign = 'bottom';
|
||||
el.style.marginBottom = '10px';
|
||||
el.refit();
|
||||
var rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.bottom, parentRect.bottom - 10, 'bottom ok');
|
||||
assert.equal(rect.height, elRect.height, 'no cropping');
|
||||
|
||||
el.style.marginBottom = '-10px';
|
||||
el.refit();
|
||||
rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.bottom, parentRect.bottom + 10, 'bottom ok');
|
||||
assert.equal(rect.height, elRect.height, 'no cropping');
|
||||
});
|
||||
|
||||
test('verticalOffset is applied', function() {
|
||||
el.verticalAlign = 'bottom';
|
||||
el.verticalOffset = 10;
|
||||
|
@ -596,6 +626,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(rect.width, elRect.width, 'no cropping');
|
||||
});
|
||||
|
||||
test('element margin is considered as offset', function() {
|
||||
el.horizontalAlign = 'left';
|
||||
el.style.marginLeft = '10px';
|
||||
el.refit();
|
||||
var rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.left, parentRect.left + 10, 'left ok');
|
||||
assert.equal(rect.width, elRect.width, 'no cropping');
|
||||
|
||||
el.style.marginLeft = '-10px';
|
||||
el.refit();
|
||||
rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.left, parentRect.left - 10, 'left ok');
|
||||
assert.equal(rect.width, elRect.width, 'no cropping');
|
||||
});
|
||||
|
||||
test('horizontalOffset is applied', function() {
|
||||
el.horizontalAlign = 'left';
|
||||
el.horizontalOffset = 10;
|
||||
|
@ -645,6 +690,21 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|||
assert.equal(rect.width, elRect.width, 'no cropping');
|
||||
});
|
||||
|
||||
test('element margin is considered as offset', function() {
|
||||
el.horizontalAlign = 'right';
|
||||
el.style.marginRight = '10px';
|
||||
el.refit();
|
||||
var rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.right, parentRect.right - 10, 'right ok');
|
||||
assert.equal(rect.width, elRect.width, 'no cropping');
|
||||
|
||||
el.style.marginRight = '-10px';
|
||||
el.refit();
|
||||
rect = el.getBoundingClientRect();
|
||||
assert.equal(rect.right, parentRect.right + 10, 'right ok');
|
||||
assert.equal(rect.width, elRect.width, 'no cropping');
|
||||
});
|
||||
|
||||
test('horizontalOffset is applied', function() {
|
||||
el.horizontalAlign = 'right';
|
||||
el.horizontalOffset = 10;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue