mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 04:14:21 +08:00
Merge branch 'master' into v4
This commit is contained in:
@ -26,6 +26,17 @@
|
|||||||
document.dir = 'ltr';
|
document.dir = 'ltr';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.domCount = function domCount(ele) {
|
||||||
|
if(!ele) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
var count = 1;
|
||||||
|
for(var i = 0; i < ele.children.length; i++) {
|
||||||
|
count += domCount(ele.children[i]);
|
||||||
|
}
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
if (location.href.indexOf('theme=dark') > -1) {
|
if (location.href.indexOf('theme=dark') > -1) {
|
||||||
var link = document.getElementById('ionicLink');
|
var link = document.getElementById('ionicLink');
|
||||||
link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css'));
|
link.setAttribute('href', link.getAttribute('href').replace('.css', '.dark.css'));
|
||||||
|
@ -8,6 +8,7 @@ export interface SelectPopoverOption {
|
|||||||
value: string;
|
value: string;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
|
handler?: Function;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @hidden */
|
/** @hidden */
|
||||||
@ -30,6 +31,10 @@ export class SelectPopover implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public set value(value: any) {
|
public set value(value: any) {
|
||||||
|
let checkedOption = this.options.find(option => option.value === value);
|
||||||
|
if (checkedOption && checkedOption.handler) {
|
||||||
|
checkedOption.handler();
|
||||||
|
}
|
||||||
this.viewController.dismiss(value);
|
this.viewController.dismiss(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,7 +301,11 @@ export class Select extends BaseInput<any> implements OnDestroy {
|
|||||||
text: input.text,
|
text: input.text,
|
||||||
checked: input.selected,
|
checked: input.selected,
|
||||||
disabled: input.disabled,
|
disabled: input.disabled,
|
||||||
value: input.value
|
value: input.value,
|
||||||
|
handler: () => {
|
||||||
|
this.value = input.value;
|
||||||
|
input.ionSelect.emit(input.value);
|
||||||
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
overlay = new Popover(this._app, SelectPopover, {
|
overlay = new Popover(this._app, SelectPopover, {
|
||||||
@ -368,12 +372,6 @@ export class Select extends BaseInput<any> implements OnDestroy {
|
|||||||
|
|
||||||
overlay.onDidDismiss((value: any) => {
|
overlay.onDidDismiss((value: any) => {
|
||||||
this._fireBlur();
|
this._fireBlur();
|
||||||
|
|
||||||
if (this.interface === 'popover' && value) {
|
|
||||||
this.value = value;
|
|
||||||
this.ionChange.emit(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
this._overlay = undefined;
|
this._overlay = undefined;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user