Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mui
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mui
Commits
68e6ca91
Commit
68e6ca91
authored
Nov 16, 2014
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
侧滑菜单隐藏时,将web view置为hidden状态;
parent
4ebed9a1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
12 deletions
+50
-12
examples/hello-mui/examples/offcanvas-left-plus-main.html
examples/hello-mui/examples/offcanvas-left-plus-main.html
+13
-1
examples/hello-mui/examples/offcanvas-right-plus-main.html
examples/hello-mui/examples/offcanvas-right-plus-main.html
+13
-1
examples/hello-mui/list.html
examples/hello-mui/list.html
+24
-10
No files found.
examples/hello-mui/examples/offcanvas-left-plus-main.html
View file @
68e6ca91
...
...
@@ -122,7 +122,8 @@
if
(
slideTogether
)
{
left
=
'
-70%
'
;
}
menu
=
mui
.
openWindow
({
//侧滑菜单默认隐藏,这样可以节省内存;
menu
=
mui
.
preload
({
id
:
'
offcanvas-plus-menu
'
,
url
:
'
offcanvas-plus-menu.html
'
,
styles
:
{
...
...
@@ -143,6 +144,17 @@
});
});
document
.
querySelector
(
'
.mui-icon-bars
'
).
addEventListener
(
'
tap
'
,
function
()
{
//控制侧滑菜单webview的显示、隐藏;
if
(
showMenu
){
//侧滑菜单已显示,则等主窗体移动完毕后,再隐藏自己;
setTimeout
(
function
()
{
menu
.
hide
();
},
300
);
}
else
{
//侧滑菜单处于隐藏状态,则立即显示出来;
menu
.
show
();
}
//主窗体开始侧滑;
mui
.
currentWebview
.
setStyle
({
left
:
showMenu
?
'
0
'
:
'
70%
'
,
transition
:
{
...
...
examples/hello-mui/examples/offcanvas-right-plus-main.html
View file @
68e6ca91
...
...
@@ -120,7 +120,7 @@
if
(
slideTogether
){
left
=
'
100%
'
;
}
menu
=
mui
.
openWindow
({
menu
=
mui
.
preload
({
id
:
'
offcanvas-plus-menu
'
,
url
:
'
offcanvas-plus-menu.html
'
,
styles
:
{
...
...
@@ -148,6 +148,18 @@
document
.
querySelector
(
"
.mui-bar-nav~.mui-content
"
).
style
.
paddingTop
=
content_padding
;
}
//控制侧滑菜单webview的显示、隐藏;
if
(
showMenu
){
//侧滑菜单已显示,则等主窗体移动完毕后,再隐藏自己;
setTimeout
(
function
()
{
menu
.
hide
();
},
300
);
}
else
{
//侧滑菜单处于隐藏状态,则立即显示出来;
menu
.
show
();
}
//主窗体开始移动
mui
.
currentWebview
.
setStyle
({
left
:
showMenu
?
'
0
'
:
'
-70%
'
,
transition
:
{
...
...
examples/hello-mui/list.html
View file @
68e6ca91
...
...
@@ -490,11 +490,22 @@
popGesture
:
"
hide
"
}
});
var
template
=
plus
.
webview
.
create
(
'
examples/template.html
'
,
'
demoTemplate
'
,{
popGesture
:
"
hide
"
});
var
subWebview
=
plus
.
webview
.
create
(
'
examples/accordion.html
'
,
'
template_sub
'
,
{
top
:
'
48px
'
,
bottom
:
'
0px
'
//预加载共用父webview
var
template
=
$
.
preload
({
url
:
'
examples/template.html
'
,
id
:
'
demoTemplate
'
,
styles
:{
popGesture
:
"
hide
"
}
});
////预加载共用子webview
var
subWebview
=
$
.
preload
({
url
:
'
examples/accordion.html
'
,
id
:
'
template_sub
'
,
styles
:{
top
:
'
48px
'
,
bottom
:
'
0px
'
}
});
var
waiting
=
null
;
subWebview
.
addEventListener
(
'
loaded
'
,
function
()
{
...
...
@@ -502,8 +513,15 @@
subWebview
.
show
();
},
50
);
});
subWebview
.
hide
();
//iOS平台支持侧滑关闭,父窗体侧滑隐藏后,同时需要隐藏子窗体;
if
(
$
.
os
.
ios
){
template
.
addEventListener
(
'
hide
'
,
function
()
{
subWebview
.
hide
(
"
none
"
);
});
}
template
.
append
(
subWebview
);
if
(
$
.
os
.
android
)
{
...
...
@@ -554,10 +572,6 @@
if
(
subWebview
.
getURL
()
==
this
.
href
){
subWebview
.
show
();
}
else
{
//为了适应ios的侧滑关闭,需要手动隐藏;
if
(
$
.
os
.
ios
){
subWebview
.
hide
(
"
none
"
);
}
subWebview
.
loadURL
(
this
.
href
);
}
template
.
show
(
'
slide-in-right
'
,
150
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment