Commit 3897711e authored by hbcui1984's avatar hbcui1984

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

parent 68e6ca91
...@@ -265,6 +265,24 @@ ...@@ -265,6 +265,24 @@
//offCanvas.offCanvas('toggle')//toggle or hide; //offCanvas.offCanvas('toggle')//toggle or hide;
offCanvas.offCanvas('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> </script>
</body> </body>
......
...@@ -279,12 +279,12 @@ ...@@ -279,12 +279,12 @@
</a> </a>
</li> </li>
<li class="mui-table-view-cell ios-only"> <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> </a>
</li> </li>
<li class="mui-table-view-cell ios-only"> <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> </a>
</li> </li>
...@@ -538,12 +538,13 @@ ...@@ -538,12 +538,13 @@
var type = this.getAttribute("open-type"); var type = this.getAttribute("open-type");
if(type=="common"){ if(type=="common"){
if (~id.indexOf('offcanvas-')) { if (~id.indexOf('offcanvas-')) {
var pop = ~id.indexOf('offcanvas-with-right')?"close":"none";
mui.openWindow({ mui.openWindow({
id: id, id: id,
url: this.href, url: this.href,
styles: { styles: {
zindex: 9999, zindex: 9999,
popGesture:"none" popGesture:pop
}, },
waiting:{ waiting:{
autoShow:false 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