mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
refactor(action-sheet): renamed elements to divs with classes
This commit is contained in:
@ -24,7 +24,7 @@ ion-action-sheet {
|
|||||||
z-index: $z-index-overlay;
|
z-index: $z-index-overlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
action-sheet-wrapper {
|
.action-sheet-wrapper {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: $z-index-overlay-wrapper;
|
z-index: $z-index-overlay-wrapper;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
|
@ -17,8 +17,8 @@ import {extend} from '../../util/util';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-action-sheet',
|
selector: 'ion-action-sheet',
|
||||||
template:
|
template:
|
||||||
'<backdrop (click)="cancel()" tappable disable-activated></backdrop>' +
|
'<div (click)="cancel()" tappable disable-activated class="backdrop"></div>' +
|
||||||
'<action-sheet-wrapper>' +
|
'<div class="action-sheet-wrapper">' +
|
||||||
'<div class="action-sheet-container">' +
|
'<div class="action-sheet-container">' +
|
||||||
'<div class="action-sheet-group action-sheet-options">' +
|
'<div class="action-sheet-group action-sheet-options">' +
|
||||||
'<div class="action-sheet-title" *ng-if="d.titleText">{{d.titleText}}</div>' +
|
'<div class="action-sheet-title" *ng-if="d.titleText">{{d.titleText}}</div>' +
|
||||||
@ -28,15 +28,17 @@ import {extend} from '../../util/util';
|
|||||||
'</button>' +
|
'</button>' +
|
||||||
'<button *ng-if="d.destructiveText" (click)="destructive()" class="action-sheet-destructive disable-hover">' +
|
'<button *ng-if="d.destructiveText" (click)="destructive()" class="action-sheet-destructive disable-hover">' +
|
||||||
'<icon [name]="d.destructiveIcon" *ng-if="d.destructiveIcon"></icon> ' +
|
'<icon [name]="d.destructiveIcon" *ng-if="d.destructiveIcon"></icon> ' +
|
||||||
'{{d.destructiveText}}</button>' +
|
'{{d.destructiveText}}' +
|
||||||
|
'</button>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'<div class="action-sheet-group action-sheet-cancel" *ng-if="d.cancelText">' +
|
'<div class="action-sheet-group action-sheet-cancel" *ng-if="d.cancelText">' +
|
||||||
'<button (click)="cancel()" class="disable-hover">' +
|
'<button (click)="cancel()" class="disable-hover">' +
|
||||||
'<icon [name]="d.cancelIcon" *ng-if="d.cancelIcon"></icon> ' +
|
'<icon [name]="d.cancelIcon" *ng-if="d.cancelIcon"></icon> ' +
|
||||||
'{{d.cancelText}}</button>' +
|
'{{d.cancelText}}' +
|
||||||
|
'</button>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</action-sheet-wrapper>',
|
'</div>',
|
||||||
host: {
|
host: {
|
||||||
'role': 'dialog'
|
'role': 'dialog'
|
||||||
},
|
},
|
||||||
@ -161,8 +163,8 @@ class ActionSheetSlideIn extends Animation {
|
|||||||
super(null, opts);
|
super(null, opts);
|
||||||
|
|
||||||
let ele = enteringView.pageRef().nativeElement;
|
let ele = enteringView.pageRef().nativeElement;
|
||||||
let backdrop = new Animation(ele.querySelector('backdrop'));
|
let backdrop = new Animation(ele.querySelector('.backdrop'));
|
||||||
let wrapper = new Animation(ele.querySelector('action-sheet-wrapper'));
|
let wrapper = new Animation(ele.querySelector('.action-sheet-wrapper'));
|
||||||
|
|
||||||
backdrop.fromTo('opacity', 0.01, 0.4);
|
backdrop.fromTo('opacity', 0.01, 0.4);
|
||||||
wrapper.fromTo('translateY', '100%', '0%');
|
wrapper.fromTo('translateY', '100%', '0%');
|
||||||
@ -178,8 +180,8 @@ class ActionSheetSlideOut extends Animation {
|
|||||||
super(null, opts);
|
super(null, opts);
|
||||||
|
|
||||||
let ele = leavingView.pageRef().nativeElement;
|
let ele = leavingView.pageRef().nativeElement;
|
||||||
let backdrop = new Animation(ele.querySelector('backdrop'));
|
let backdrop = new Animation(ele.querySelector('.backdrop'));
|
||||||
let wrapper = new Animation(ele.querySelector('action-sheet-wrapper'));
|
let wrapper = new Animation(ele.querySelector('.action-sheet-wrapper'));
|
||||||
|
|
||||||
backdrop.fromTo('opacity', 0.4, 0);
|
backdrop.fromTo('opacity', 0.4, 0);
|
||||||
wrapper.fromTo('translateY', '0%', '100%');
|
wrapper.fromTo('translateY', '0%', '100%');
|
||||||
@ -195,8 +197,8 @@ class ActionSheetMdSlideIn extends Animation {
|
|||||||
super(null, opts);
|
super(null, opts);
|
||||||
|
|
||||||
let ele = enteringView.pageRef().nativeElement;
|
let ele = enteringView.pageRef().nativeElement;
|
||||||
let backdrop = new Animation(ele.querySelector('backdrop'));
|
let backdrop = new Animation(ele.querySelector('.backdrop'));
|
||||||
let wrapper = new Animation(ele.querySelector('action-sheet-wrapper'));
|
let wrapper = new Animation(ele.querySelector('.action-sheet-wrapper'));
|
||||||
|
|
||||||
backdrop.fromTo('opacity', 0.01, 0.26);
|
backdrop.fromTo('opacity', 0.01, 0.26);
|
||||||
wrapper.fromTo('translateY', '100%', '0%');
|
wrapper.fromTo('translateY', '100%', '0%');
|
||||||
@ -212,8 +214,8 @@ class ActionSheetMdSlideOut extends Animation {
|
|||||||
super(null, opts);
|
super(null, opts);
|
||||||
|
|
||||||
let ele = leavingView.pageRef().nativeElement;
|
let ele = leavingView.pageRef().nativeElement;
|
||||||
let backdrop = new Animation(ele.querySelector('backdrop'));
|
let backdrop = new Animation(ele.querySelector('.backdrop'));
|
||||||
let wrapper = new Animation(ele.querySelector('action-sheet-wrapper'));
|
let wrapper = new Animation(ele.querySelector('.action-sheet-wrapper'));
|
||||||
|
|
||||||
backdrop.fromTo('opacity', 0.26, 0);
|
backdrop.fromTo('opacity', 0.26, 0);
|
||||||
wrapper.fromTo('translateY', '0%', '100%');
|
wrapper.fromTo('translateY', '0%', '100%');
|
||||||
|
@ -26,17 +26,6 @@ ion-action-sheet {
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-sheet-container {
|
|
||||||
padding: 0 $action-sheet-ios-group-margin;
|
|
||||||
|
|
||||||
button.activated {
|
|
||||||
box-shadow: none;
|
|
||||||
border-color: $action-sheet-options-border-color;
|
|
||||||
color: $action-sheet-options-text-color;
|
|
||||||
background: $action-sheet-options-background-active-color;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ion-action-sheet button {
|
ion-action-sheet button {
|
||||||
min-height: $action-sheet-ios-height;
|
min-height: $action-sheet-ios-height;
|
||||||
padding: $action-sheet-ios-padding;
|
padding: $action-sheet-ios-padding;
|
||||||
@ -51,6 +40,17 @@ ion-action-sheet button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-sheet-container {
|
||||||
|
padding: 0 $action-sheet-ios-group-margin;
|
||||||
|
|
||||||
|
button.activated {
|
||||||
|
box-shadow: none;
|
||||||
|
border-color: $action-sheet-options-border-color;
|
||||||
|
color: $action-sheet-options-text-color;
|
||||||
|
background: $action-sheet-options-background-active-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.action-sheet-group {
|
.action-sheet-group {
|
||||||
margin-bottom: $action-sheet-ios-group-margin - 2;
|
margin-bottom: $action-sheet-ios-group-margin - 2;
|
||||||
border-radius: $action-sheet-ios-border-radius;
|
border-radius: $action-sheet-ios-border-radius;
|
||||||
|
@ -4,5 +4,5 @@ it('should open action sheet', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('should close with backdrop click', function() {
|
it('should close with backdrop click', function() {
|
||||||
element(by.css('backdrop')).click();
|
element(by.css('.backdrop')).click();
|
||||||
});
|
});
|
||||||
|
@ -141,7 +141,7 @@ focus-ctrl {
|
|||||||
|
|
||||||
$backdrop-color: #000 !default;
|
$backdrop-color: #000 !default;
|
||||||
|
|
||||||
backdrop {
|
.backdrop {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: $z-index-backdrop;
|
z-index: $z-index-backdrop;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
Reference in New Issue
Block a user