mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-13 13:08:47 +08:00
refactor(content): add ion-fixed component and move from content
This commit is contained in:
@@ -62,24 +62,6 @@ ion-content.has-refresher ion-scroll {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
// Fixed Content (ion-fixed and ion-fab)
|
||||
// --------------------------------------------------
|
||||
|
||||
.fixed-content {
|
||||
@include position(0, 0, 0, 0);
|
||||
|
||||
position: absolute;
|
||||
display: block;
|
||||
}
|
||||
|
||||
[ion-fixed] {
|
||||
position: absolute;
|
||||
|
||||
z-index: $z-index-fixed-content;
|
||||
|
||||
transform: translateZ(0);
|
||||
}
|
||||
|
||||
|
||||
// Content Padding
|
||||
// --------------------------------------------------
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Component, h, Ionic, Prop } from '@stencil/core';
|
||||
import { createThemedClasses } from '../../utils/theme';
|
||||
import { getParentElement } from '../../utils/helpers';
|
||||
import { getParentElement, getToolbarHeight } from '../../utils/helpers';
|
||||
import { Scroll } from '../scroll/scroll-interface';
|
||||
import { ScrollDetail } from '../../utils/interfaces';
|
||||
|
||||
@@ -112,23 +112,3 @@ export class Content {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getToolbarHeight(toolbarTagName: string, pageChildren: HTMLElement[], mode: string, iosHeight: string, defaultHeight: string) {
|
||||
for (var i = 0; i < pageChildren.length; i++) {
|
||||
if (pageChildren[i].tagName === toolbarTagName) {
|
||||
var headerHeight = pageChildren[i].getAttribute(`${mode}-height`);
|
||||
if (headerHeight) {
|
||||
return headerHeight;
|
||||
}
|
||||
|
||||
if (mode === 'ios') {
|
||||
return iosHeight;
|
||||
}
|
||||
|
||||
return defaultHeight;
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user