mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
refactor(): rename some setCssClass to setElementClass
This commit is contained in:
@ -73,14 +73,14 @@ export class ApiDemoPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
expandAction(item: ItemSliding, action: string, text: string) {
|
expandAction(item: ItemSliding, action: string, text: string) {
|
||||||
// TODO item.setCssClass(action, true);
|
// TODO item.setElementClass(action, true);
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const toast = this.toastCtrl.create({
|
const toast = this.toastCtrl.create({
|
||||||
message: text
|
message: text
|
||||||
});
|
});
|
||||||
toast.present();
|
toast.present();
|
||||||
// TODO item.setCssClass(action, false);
|
// TODO item.setElementClass(action, false);
|
||||||
item.close();
|
item.close();
|
||||||
|
|
||||||
setTimeout(() => toast.dismiss(), 2000);
|
setTimeout(() => toast.dismiss(), 2000);
|
||||||
|
@ -210,7 +210,7 @@ export class ItemReorder {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
reorderStart() {
|
reorderStart() {
|
||||||
this.setCssClass('reorder-list-active', true);
|
this.setElementClass('reorder-list-active', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -246,7 +246,7 @@ export class ItemReorder {
|
|||||||
let children = this._element.children;
|
let children = this._element.children;
|
||||||
let len = children.length;
|
let len = children.length;
|
||||||
|
|
||||||
this.setCssClass('reorder-list-active', false);
|
this.setElementClass('reorder-list-active', false);
|
||||||
let transform = CSS.transform;
|
let transform = CSS.transform;
|
||||||
for (let i = 0; i < len; i++) {
|
for (let i = 0; i < len; i++) {
|
||||||
(<any>children[i]).style[transform] = '';
|
(<any>children[i]).style[transform] = '';
|
||||||
@ -294,7 +294,7 @@ export class ItemReorder {
|
|||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
setCssClass(classname: string, add: boolean) {
|
setElementClass(classname: string, add: boolean) {
|
||||||
this._rendered.setElementClass(this._element, classname, add);
|
this._rendered.setElementClass(this._element, classname, add);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -79,13 +79,13 @@ export class SegmentButton {
|
|||||||
|
|
||||||
set disabled(val: boolean) {
|
set disabled(val: boolean) {
|
||||||
this._disabled = isTrueProperty(val);
|
this._disabled = isTrueProperty(val);
|
||||||
this._setCssClass('segment-button-disabled', this._disabled);
|
this._setElementClass('segment-button-disabled', this._disabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_setCssClass(cssClass: string, shouldAdd: boolean) {
|
_setElementClass(cssClass: string, shouldAdd: boolean) {
|
||||||
this._renderer.setElementClass(this._elementRef.nativeElement, cssClass, shouldAdd);
|
this._renderer.setElementClass(this._elementRef.nativeElement, cssClass, shouldAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,7 +240,7 @@ export class Segment extends Ion {
|
|||||||
|
|
||||||
if (this._buttons) {
|
if (this._buttons) {
|
||||||
this._buttons.forEach(button => {
|
this._buttons.forEach(button => {
|
||||||
button._setCssClass('segment-button-disabled', this._disabled);
|
button._setElementClass('segment-button-disabled', this._disabled);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,7 +275,7 @@ export class Segment extends Ion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isTrueProperty(this._disabled)) {
|
if (isTrueProperty(this._disabled)) {
|
||||||
button._setCssClass('segment-button-disabled', this._disabled);
|
button._setElementClass('segment-button-disabled', this._disabled);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user