mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
Merge branch 'master' of https://github.com/driftyco/ionic
Conflicts: dist/ionic.js js/events.js
This commit is contained in:
@@ -26,6 +26,8 @@
|
||||
<a class="button button-warning">Warning</a>
|
||||
<a class="button button-danger">Danger</a>
|
||||
<a class="button button-dark">Dark</a>
|
||||
<a class="button button-icon"><i class="icon-home"></i></a>
|
||||
<a class="button button-clear">Borderless</a>
|
||||
</p>
|
||||
<p><a class="button button-secondary" href="index.html">Homepage</a></p>
|
||||
</main>
|
||||
@@ -35,5 +37,21 @@
|
||||
<script src="../dist/ionic.js"></script>
|
||||
<script src="../dist/ionic-simple.js"></script>
|
||||
|
||||
<script>
|
||||
var buttons = document.querySelectorAll('.button');
|
||||
var a;
|
||||
for(var i = 0; i < buttons.length; i++) {
|
||||
a = buttons[i];
|
||||
a.addEventListener('touchstart', function() {
|
||||
this.classList.add('active');
|
||||
});
|
||||
a.addEventListener('touchend', function() {
|
||||
this.classList.remove('active');
|
||||
});
|
||||
a.addEventListener('touchcancel', function() {
|
||||
this.classList.remove('active');
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
describe('Ionic Events', function() {
|
||||
it('Should block all click events', function() {
|
||||
var a = document.createElement('a');
|
||||
a.click();
|
||||
|
||||
ionic.trigger('click', {
|
||||
target: a
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user