mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
29 lines
580 B
JavaScript
29 lines
580 B
JavaScript
(function(window) {
|
|
|
|
iconic = window.iconic || {};
|
|
|
|
// add tap events to links
|
|
function onToggleTap(e) {
|
|
if(e.currentTarget.control) {
|
|
e.currentTarget.control.checked = !e.currentTarget.control.checked;
|
|
e.stopPropagation();
|
|
}
|
|
}
|
|
|
|
ionic.ResetToggles = function() {
|
|
var
|
|
x,
|
|
toggles = document.getElementsByClassName("toggle");
|
|
|
|
for(x = 0; x < toggles.length; x++) {
|
|
if(!toggles[x].hasTap) {
|
|
ionic.on('tap', onToggleTap, toggles[x]);
|
|
toggles[x].hasTap = true;
|
|
}
|
|
}
|
|
};
|
|
|
|
ionic.ResetToggles();
|
|
|
|
})(this);
|