Commit 3897711e authored by hbcui1984's avatar hbcui1984

可拖动式左滑菜单支持ios平台原生的右滑关闭窗口

parent 68e6ca91
......@@ -265,6 +265,24 @@
//offCanvas.offCanvas('toggle')//toggle or hide;
offCanvas.offCanvas('hide');
});
//实现ios平台的侧滑关闭页面;
if(mui.os.ios){
var classList = offCanvasContainer.classList;
offCanvasContainer.addEventListener('webkitTransitionEnd', function(e) {
if (e.target && e.target.classList.contains('mui-inner-wrap')) {
if (classList.contains('mui-right') || classList.contains('mui-left')) {
//显示状态
mui.currentWebview.setStyle({'popGesture':'none'});
} else {
mui.currentWebview.setStyle({'popGesture':'close'});
}
}
});
}
</script>
</body>
......
......@@ -279,12 +279,12 @@
</a>
</li>
<li class="mui-table-view-cell ios-only">
<a class="mui-navigate-right" open-type="common" href="examples/offcanvas-with-left.html">
<a class="mui-navigate-right" open-type="common" href="examples/offcanvas-drag-right.html">
可拖动式右滑菜单
</a>
</li>
<li class="mui-table-view-cell ios-only">
<a class="mui-navigate-right" open-type="common" href="examples/offcanvas-with-right.html">
<a class="mui-navigate-right" open-type="common" href="examples/offcanvas-drag-left.html">
可拖动式左滑菜单
</a>
</li>
......@@ -538,12 +538,13 @@
var type = this.getAttribute("open-type");
if(type=="common"){
if (~id.indexOf('offcanvas-')) {
var pop = ~id.indexOf('offcanvas-with-right')?"close":"none";
mui.openWindow({
id: id,
url: this.href,
styles: {
zindex: 9999,
popGesture:"none"
popGesture:pop
},
waiting:{
autoShow:false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment