mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-11 00:33:16 +00:00
Fix ripple with position:absolute|fixed elements
This commit is contained in:
parent
fc79898cf7
commit
bedd443726
2 changed files with 7 additions and 5 deletions
|
|
@ -56,21 +56,23 @@ export default function install(Vue) {
|
|||
return ripple;
|
||||
};
|
||||
|
||||
let checkPositionRelative = (element) => {
|
||||
return getComputedStyle(element).position === 'relative';
|
||||
let checkPositionedParent = (element) => {
|
||||
let availablePositions = ['relative', 'absolute', 'fixed'];
|
||||
|
||||
return availablePositions.indexOf(getComputedStyle(element).position) > -1;
|
||||
};
|
||||
|
||||
let getParentWithPositionRelatve = (element) => {
|
||||
let found = false;
|
||||
|
||||
if (checkPositionRelative(element)) {
|
||||
if (checkPositionedParent(element)) {
|
||||
return element;
|
||||
}
|
||||
|
||||
while (!found) {
|
||||
let parent = element.parentNode;
|
||||
|
||||
if (parent && checkPositionRelative(parent)) {
|
||||
if (parent && checkPositionedParent(parent)) {
|
||||
found = parent;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<section>
|
||||
<h2 class="title">FAB</h2>
|
||||
|
||||
<md-button class="md-fab">
|
||||
<md-button class="md-fab md-fab-bottom-right">
|
||||
<md-icon>add</md-icon>
|
||||
</md-button>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue