Skip to content

Commit

Permalink
test(button): add a dynamically disabled button to the basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
brandyscarney committed Jul 12, 2018
1 parent 0421e21 commit 8e58ea4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion core/src/components/button/test/basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@
</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>
</p>

<p>
<ion-button onclick="toggleDisabled()">Toggle Disabled</ion-button>
</p>

<p>
<ion-button id="dynamicColor1" onclick="changeColor(event)">Change Color</ion-button>
<ion-button id="dynamicColor2" onclick="changeColor(event)" fill="outline">Change Color</ion-button>
Expand All @@ -98,6 +102,16 @@

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>
</body>

Expand Down

0 comments on commit 8e58ea4

Please sign in to comment.