mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 06:57:02 +08:00
Random angular stuff and testing things
This commit is contained in:
28
ext/default/panel-handler.js
Normal file
28
ext/default/panel-handler.js
Normal file
@ -0,0 +1,28 @@
|
||||
(function(window, document, ion) {
|
||||
|
||||
function click(e) {
|
||||
panelToggle(e, e.target);
|
||||
}
|
||||
|
||||
function panelToggle(e, el) {
|
||||
if(el) {
|
||||
if(el.dataset && el.dataset.panelToggle) {
|
||||
|
||||
var options = {
|
||||
direction: (el.dataset.panelDirection === "right" ? "right" : "left")
|
||||
};
|
||||
|
||||
ion.Panel.toggle(el.dataset.panelToggle, options);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
panelToggle(e, el.parentNode);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('click', click, false);
|
||||
window.addEventListener('touchend', click, false);
|
||||
|
||||
})(this, document, ion = this.ion || {});
|
||||
Reference in New Issue
Block a user