mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
redo click handler for panel
This commit is contained in:
@@ -1,21 +1,28 @@
|
||||
(function(window, document, ion) {
|
||||
|
||||
function click(e) {
|
||||
if(e.target.dataset.panelToggle) {
|
||||
panelToggle(e, e.target);
|
||||
}
|
||||
|
||||
var options = {
|
||||
direction: (e.target.dataset.panelDirection === "right" ? "right" : "left")
|
||||
};
|
||||
function panelToggle(e, el) {
|
||||
if(el) {
|
||||
if(el.dataset.panelToggle) {
|
||||
|
||||
ion.Panel.toggle(e.target.dataset.panelToggle, options);
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
return false;
|
||||
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 || {});
|
||||
})(this, document, ion = this.ion || {});
|
||||
|
||||
Reference in New Issue
Block a user