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
c76be454
Commit
c76be454
authored
Sep 19, 2014
by
hbcui1984
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
补充preload函数
parent
39192bcc
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
287 additions
and
236 deletions
+287
-236
dist/js/mui.js
dist/js/mui.js
+176
-127
dist/js/mui.min.js
dist/js/mui.min.js
+2
-2
examples/hello-mui/examples/offcanvas-left-plus-main.html
examples/hello-mui/examples/offcanvas-left-plus-main.html
+5
-4
examples/hello-mui/examples/offcanvas-right-plus-main.html
examples/hello-mui/examples/offcanvas-right-plus-main.html
+4
-2
examples/hello-mui/js/mui.min.js
examples/hello-mui/js/mui.min.js
+2
-2
examples/hello-mui/list.html
examples/hello-mui/list.html
+98
-99
No files found.
dist/js/mui.js
View file @
c76be454
This diff is collapsed.
Click to expand it.
dist/js/mui.min.js
View file @
c76be454
This diff is collapsed.
Click to expand it.
examples/hello-mui/examples/offcanvas-left-plus-main.html
View file @
c76be454
...
@@ -127,18 +127,19 @@
...
@@ -127,18 +127,19 @@
if
(
slideTogether
)
{
if
(
slideTogether
)
{
left
=
'
-70%
'
;
left
=
'
-70%
'
;
}
}
menu
=
mui
.
create
Window
({
menu
=
mui
.
open
Window
({
id
:
'
offcanvas-plus-menu
'
,
id
:
'
offcanvas-plus-menu
'
,
url
:
'
offcanvas-plus-menu.html
'
,
url
:
'
offcanvas-plus-menu.html
'
,
styles
:
{
styles
:
{
left
:
left
,
left
:
left
,
width
:
'
70%
'
,
width
:
'
70%
'
,
zindex
:
9998
zindex
:
9998
},
show
:{
aniShow
:
'
none
'
}
}
});
});
if
(
menu
)
{
//初始化主页面位置
menu
.
show
(
'
none
'
);
}
mui
.
currentWebview
.
setStyle
({
mui
.
currentWebview
.
setStyle
({
left
:
0
left
:
0
});
});
...
...
examples/hello-mui/examples/offcanvas-right-plus-main.html
View file @
c76be454
...
@@ -124,16 +124,18 @@
...
@@ -124,16 +124,18 @@
if
(
slideTogether
){
if
(
slideTogether
){
left
=
'
100%
'
;
left
=
'
100%
'
;
}
}
menu
=
mui
.
create
Window
({
menu
=
mui
.
open
Window
({
id
:
'
offcanvas-plus-menu
'
,
id
:
'
offcanvas-plus-menu
'
,
url
:
'
offcanvas-plus-menu.html
'
,
url
:
'
offcanvas-plus-menu.html
'
,
styles
:
{
styles
:
{
left
:
'
30%
'
,
left
:
'
30%
'
,
width
:
'
70%
'
,
width
:
'
70%
'
,
zindex
:
9998
zindex
:
9998
},
show
:{
aniShow
:
'
none
'
}
}
});
});
menu
.
show
(
'
none
'
);
mui
.
currentWebview
.
setStyle
({
left
:
0
});
mui
.
currentWebview
.
setStyle
({
left
:
0
});
});
});
//点击侧滑按钮
//点击侧滑按钮
...
...
examples/hello-mui/js/mui.min.js
View file @
c76be454
This diff is collapsed.
Click to expand it.
examples/hello-mui/list.html
View file @
c76be454
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
</li>-->
</li>-->
</ul>
</ul>
</li>
</li>
<li
class=
"mui-table-view-cell"
>
<li
class=
"mui-table-view-cell"
>
<a
class=
"mui-navigate-right"
href=
"examples/icons.html"
>
<a
class=
"mui-navigate-right"
href=
"examples/icons.html"
>
icon(图标)
icon(图标)
...
@@ -361,7 +361,7 @@
...
@@ -361,7 +361,7 @@
</li>
</li>
</ul>
</ul>
</li>
</li>
<li
class=
"mui-table-view-cell"
>
<li
class=
"mui-table-view-cell"
>
<a
class=
"mui-navigate-right"
href=
"examples/radio.html"
>
<a
class=
"mui-navigate-right"
href=
"examples/radio.html"
>
radio(单选框)
radio(单选框)
...
@@ -394,9 +394,9 @@
...
@@ -394,9 +394,9 @@
switch(开关)
switch(开关)
</a>
</a>
</li>
</li>
<li
class=
"mui-table-view-cell mui-collapse"
>
<li
class=
"mui-table-view-cell mui-collapse"
>
<a
class=
"mui-navigate-right"
href=
"#"
>
<a
class=
"mui-navigate-right"
href=
"#"
>
tab bar(选项卡)
tab bar(选项卡)
...
@@ -407,7 +407,7 @@
...
@@ -407,7 +407,7 @@
div模式
div模式
</a>
</a>
</li>
</li>
<li
class=
"mui-table-view-cell"
>
<li
class=
"mui-table-view-cell"
>
<a
class=
"mui-navigate-right"
href=
"examples/tab-webview-main.html"
>
<a
class=
"mui-navigate-right"
href=
"examples/tab-webview-main.html"
>
webview模式
webview模式
</a>
</a>
...
@@ -453,7 +453,7 @@
...
@@ -453,7 +453,7 @@
弹出窗口(Modals)
弹出窗口(Modals)
</a>
</a>
</li>-->
</li>-->
<!--<li class="mui-table-view-cell">
<!--<li class="mui-table-view-cell">
<a class="mui-navigate-right" href="examples/preload.html">
<a class="mui-navigate-right" href="examples/preload.html">
...
@@ -502,110 +502,109 @@
...
@@ -502,110 +502,109 @@
</ul>
</ul>
</div>
</div>
<script>
<script>
var
limit
=
5
,
count
=
0
;
var
limit
=
3
,
count
=
0
;
mui
.
init
({
mui
.
init
({
preloadLimit
:
limit
,
//同时并存的预加载窗口数量
preloadLimit
:
limit
,
//同时并存的预加载窗口数量
swipeBack
:
false
,
swipeBack
:
false
,
});
});
$
.
plusReady
(
function
()
{
(
function
(
$
)
{
//初始化一级列表的预加载
$
.
plusReady
(
function
()
{
$
(
'
#list>.mui-table-view-cell
'
,
document
.
body
).
each
(
function
()
{
//初始化一级列表的预加载
//只预加载一级列表,二级列表在其展开时再预加载;
$
(
'
#list>.mui-table-view-cell
'
,
document
.
body
).
each
(
function
()
{
if
(
!
this
.
classList
.
contains
(
'
mui-collapse
'
))
{
//只预加载一级列表,二级列表在其展开时再预加载;
var
url
=
this
.
querySelector
(
'
a
'
).
getAttribute
(
"
href
"
);
if
(
!
this
.
classList
.
contains
(
'
mui-collapse
'
))
{
//预加载,默认使用url作为其id
var
url
=
this
.
querySelector
(
'
a
'
).
getAttribute
(
"
href
"
);
$
.
createWindow
({
//预加载,默认使用url作为其id
url
:
url
,
$
.
preload
({
preload
:
true
url
:
url
,
});
});
if
(
++
count
>=
limit
)
{
if
(
++
count
>=
limit
)
{
return
false
;
return
false
;
}
}
}
}
});
});
//监听展开事件,预加载二级列表的前几个;
//监听展开事件,预加载二级列表的前几个;
$
(
'
#list
'
).
on
(
'
expand
'
,
'
.mui-collapse
'
,
function
(
e
)
{
$
(
'
#list
'
).
on
(
'
expand
'
,
'
.mui-collapse
'
,
function
(
e
)
{
count
=
0
;
count
=
0
;
$
(
'
.mui-table-view a
'
,
this
).
each
(
function
()
{
$
(
'
.mui-table-view a
'
,
this
).
each
(
function
()
{
var
url
=
this
.
getAttribute
(
"
href
"
);
var
url
=
this
.
getAttribute
(
"
href
"
);
if
(
~
url
.
indexOf
(
'
.html
'
))
{
if
(
~
url
.
indexOf
(
'
.html
'
))
{
//单独处理侧滑导航的index
//单独处理侧滑导航的index
if
(
~
url
.
indexOf
(
'
offcanvas-
'
)){
if
(
~
url
.
indexOf
(
'
offcanvas-
'
))
{
$
.
createWindow
({
$
.
preload
({
url
:
url
,
url
:
url
,
styles
:{
styles
:
{
zindex
:
9999
zindex
:
9999
},
},
preload
:
true
});
});
}
else
{
}
else
{
$
.
preload
({
$
.
createWindow
({
url
:
url
,
url
:
url
,
});
preload
:
true
}
});
if
(
++
count
>=
limit
)
{
}
return
false
;
if
(
++
count
>=
limit
){
}
return
false
;
}
}
}
});
});
});
});
// 关闭启动界面
// 关闭启动界面
plus
.
navigator
.
closeSplashscreen
();
plus
.
navigator
.
closeSplashscreen
();
//下拉刷新两个平台有区别;
//下拉刷新两个平台有区别;
if
(
$
.
os
.
ios
)
{
if
(
$
.
os
.
ios
)
{
document
.
getElementById
(
'
pull-refresh-pandora
'
).
style
.
display
=
"
none
"
;
document
.
getElementById
(
'
pull-refresh-pandora
'
).
style
.
display
=
"
none
"
;
}
else
if
(
$
.
os
.
android
)
{
}
else
if
(
$
.
os
.
android
)
{
document
.
getElementById
(
'
pull-refresh-h5
'
).
style
.
display
=
"
none
"
;
document
.
getElementById
(
'
pull-refresh-h5
'
).
style
.
display
=
"
none
"
;
var
list
=
document
.
querySelectorAll
(
'
.ios-only
'
);
var
list
=
document
.
querySelectorAll
(
'
.ios-only
'
);
if
(
list
){
if
(
list
)
{
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
){
for
(
var
i
=
0
;
i
<
list
.
length
;
i
++
)
{
list
[
i
].
style
.
display
=
'
none
'
;
list
[
i
].
style
.
display
=
'
none
'
;
}
}
}
}
}
}
});
});
/**
/**
* 处理链接点击事件
* 处理链接点击事件
*/
*/
$
.
ready
(
function
()
{
$
.
ready
(
function
()
{
$
(
'
body
'
).
on
(
'
tap
'
,
'
a
'
,
function
(
e
)
{
$
(
'
body
'
).
on
(
'
tap
'
,
'
a
'
,
function
(
e
)
{
var
id
=
this
.
getAttribute
(
'
href
'
);
var
id
=
this
.
getAttribute
(
'
href
'
);
if
(
id
)
{
if
(
id
)
{
if
(
~
id
.
indexOf
(
'
.html
'
))
{
if
(
~
id
.
indexOf
(
'
.html
'
))
{
if
(
window
.
plus
)
{
if
(
window
.
plus
)
{
//侧滑导航涉及Index问题,需要单独处理;
//侧滑导航涉及Index问题,需要单独处理;
if
(
~
id
.
indexOf
(
'
offcanvas-
'
))
{
if
(
~
id
.
indexOf
(
'
offcanvas-
'
)){
$
.
openWindow
({
$
.
openWindow
({
id
:
id
,
id
:
id
,
url
:
this
.
href
,
url
:
this
.
href
,
styles
:
{
styles
:{
zindex
:
9999
zindex
:
9999
},
},
preload
:
true
preload
:
true
});
});
}
else
{
}
else
{
$
.
openWindow
({
$
.
openWindow
({
id
:
id
,
id
:
id
,
url
:
this
.
href
,
url
:
this
.
href
,
preload
:
true
preload
:
true
});
});
}
}
else
{
document
.
location
.
href
=
this
.
href
;
}
}
else
{
if
(
typeof
plus
!==
'
undefined
'
)
{
plus
.
runtime
.
openURL
(
id
);
}
}
}
}
}
else
{
});
document
.
location
.
href
=
this
.
href
;
});
}
})(
mui
);
}
else
{
if
(
typeof
plus
!==
'
undefined
'
)
{
plus
.
runtime
.
openURL
(
id
);
}
}
}
});
});
</script>
</script>
</body>
</body>
...
...
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