mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-08 23:58:13 +08:00
ion panels!
This commit is contained in:
21
js/framework/helpers/panel-helper.js
Normal file
21
js/framework/helpers/panel-helper.js
Normal file
@ -0,0 +1,21 @@
|
||||
(function(window, document, ion) {
|
||||
|
||||
function click(e) {
|
||||
if(e.target.dataset.togglePanel) {
|
||||
ion.Panel.toggle(e.target.dataset.togglePanel);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function touchEnd(e) {
|
||||
if(click(e)) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('click', click, false);
|
||||
window.addEventListener('touchend', touchEnd, false);
|
||||
|
||||
})(this, document, ion = this.ion || {});
|
||||
Reference in New Issue
Block a user