mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
test(button): add a dynamically disabled button to the basic test
This commit is contained in:
@ -70,10 +70,14 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<ion-button disabled>Button Disabled</ion-button>
|
<ion-button id="disabledButton" disabled onclick="clickedButton(event)">Button Disabled</ion-button>
|
||||||
<ion-button color="secondary" disabled>Secondary Disabled</ion-button>
|
<ion-button color="secondary" disabled>Secondary Disabled</ion-button>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<ion-button onclick="toggleDisabled()">Toggle Disabled</ion-button>
|
||||||
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<ion-button id="dynamicColor1" onclick="changeColor(event)">Change Color</ion-button>
|
<ion-button id="dynamicColor1" onclick="changeColor(event)">Change Color</ion-button>
|
||||||
<ion-button id="dynamicColor2" onclick="changeColor(event)" fill="outline">Change Color</ion-button>
|
<ion-button id="dynamicColor2" onclick="changeColor(event)" fill="outline">Change Color</ion-button>
|
||||||
@ -98,6 +102,16 @@
|
|||||||
|
|
||||||
el.color = newColor;
|
el.color = newColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggleDisabled() {
|
||||||
|
var buttonEl = this.document.getElementById('disabledButton');
|
||||||
|
console.log(buttonEl);
|
||||||
|
buttonEl.disabled = !buttonEl.disabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
function clickedButton(ev) {
|
||||||
|
console.log("Clicked button", ev);
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user