Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
f578c9e9
Z
zui
项目概览
易企天创
/
zui
大约 1 年 前同步成功
通知
6
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
37
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Z
zui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
37
Issue
37
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f578c9e9
编写于
4月 25, 2019
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* finish task
#6
.
上级
4e16e777
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
143 addition
and
51 deletion
+143
-51
dist/lib/chosen/chosen.css
dist/lib/chosen/chosen.css
+16
-0
dist/lib/chosen/chosen.js
dist/lib/chosen/chosen.js
+53
-24
dist/lib/chosen/chosen.min.css
dist/lib/chosen/chosen.min.css
+1
-1
dist/lib/chosen/chosen.min.js
dist/lib/chosen/chosen.min.js
+1
-1
src/js/chosen.js
src/js/chosen.js
+53
-24
src/js/colorset.js
src/js/colorset.js
+1
-1
src/less/modules/chosen.less
src/less/modules/chosen.less
+18
-0
未找到文件。
dist/lib/chosen/chosen.css
浏览文件 @
f578c9e9
...
...
@@ -34,6 +34,22 @@
.chosen-container
.chosen-drop.chosen-drop-size-limited
{
border-top
:
1px
solid
rgba
(
0
,
0
,
0
,
.15
);
}
.chosen-container
.chosen-drop.chosen-auto-max-width
{
min-width
:
100%
;
border-top
:
1px
solid
rgba
(
0
,
0
,
0
,
.15
);
opacity
:
.5
;
}
.chosen-container
.chosen-drop.chosen-auto-max-width
>
.chosen-results
>
li
{
display
:
inline-block
;
white-space
:
nowrap
;
}
.chosen-container
.chosen-drop.chosen-auto-max-width.in
{
opacity
:
1
;
}
.chosen-container
.chosen-drop.chosen-auto-max-width.in
>
.chosen-results
>
li
{
display
:
block
;
white-space
:
normal
;
}
.chosen-container.chosen-with-drop
.chosen-drop
{
display
:
block
;
}
...
...
dist/lib/chosen/chosen.js
浏览文件 @
f578c9e9
...
...
@@ -19,6 +19,8 @@
* 3. ‘middle_highlight’ option can make hightlight item in the middle of
* the dropdown menu;
* 4. 'compact_search' option
* 5. 'drop_width' option
* 6. 'max_drop_width' option
* ======================================================================== */
...
...
@@ -208,6 +210,11 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
this
.
compact_search
=
this
.
options
.
compact_search
||
false
;
this
.
inherit_select_classes
=
this
.
options
.
inherit_select_classes
||
false
;
this
.
display_selected_options
=
this
.
options
.
display_selected_options
!=
null
?
this
.
options
.
display_selected_options
:
true
;
var
max_drop_width
=
this
.
options
.
max_drop_width
;
if
(
typeof
max_drop_width
===
'
string
'
&&
max_drop_width
.
indexOf
(
'
px
'
)
===
(
max_drop_width
.
length
-
2
))
{
max_drop_width
=
parseInt
(
max_drop_width
.
substring
(
0
,
max_drop_width
.
length
-
2
));
}
this
.
max_drop_width
=
max_drop_width
;
return
this
.
display_disabled_options
=
this
.
options
.
display_disabled_options
!=
null
?
this
.
options
.
display_disabled_options
:
true
;
};
...
...
@@ -673,6 +680,9 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
if
(
this
.
options
.
drop_width
)
{
this
.
dropdown
.
css
(
'
width
'
,
this
.
options
.
drop_width
).
addClass
(
'
chosen-drop-size-limited
'
);
}
if
(
this
.
max_drop_width
)
{
this
.
dropdown
.
addClass
(
'
chosen-auto-max-width
'
);
}
this
.
results_build
();
this
.
set_tab_index
();
this
.
set_label_behavior
();
...
...
@@ -923,39 +933,53 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
};
Chosen
.
prototype
.
results_show
=
function
()
{
if
(
this
.
is_multiple
&&
this
.
max_selected_options
<=
this
.
choices_count
())
{
this
.
form_field_jq
.
trigger
(
"
chosen:maxselected
"
,
{
var
that
=
this
;
if
(
that
.
is_multiple
&&
that
.
max_selected_options
<=
that
.
choices_count
())
{
that
.
form_field_jq
.
trigger
(
"
chosen:maxselected
"
,
{
chosen
:
this
});
return
false
;
}
th
is
.
results_showing
=
true
;
th
is
.
search_field
.
focus
();
th
is
.
search_field
.
val
(
this
.
search_field
.
val
());
th
at
.
results_showing
=
true
;
th
at
.
search_field
.
focus
();
th
at
.
search_field
.
val
(
that
.
search_field
.
val
());
var
dropDirection
=
this
.
drop_direction
;
if
(
$
.
isFunction
(
dropDirection
))
{
var
dropDirection
=
that
.
drop_direction
;
if
(
$
.
isFunction
(
dropDirection
))
{
dropDirection
=
dropDirection
.
call
(
this
);
}
if
(
dropDirection
===
'
auto
'
)
{
if
(
!
th
is
.
drop_directionFixed
)
{
var
$drop
=
th
is
.
container
.
find
(
'
.chosen-drop
'
);
var
offset
=
th
is
.
container
.
offset
();
if
(
!
th
at
.
drop_directionFixed
)
{
var
$drop
=
th
at
.
container
.
find
(
'
.chosen-drop
'
);
var
offset
=
th
at
.
container
.
offset
();
if
(
offset
.
top
+
$drop
.
outerHeight
()
+
30
>
$
(
window
).
height
()
+
$
(
window
).
scrollTop
())
{
dropDirection
=
'
up
'
;
}
th
is
.
drop_directionFixed
=
dropDirection
;
th
at
.
drop_directionFixed
=
dropDirection
;
}
else
{
dropDirection
=
th
is
.
drop_directionFixed
;
dropDirection
=
th
at
.
drop_directionFixed
;
}
}
th
is
.
container
.
toggleClass
(
'
chosen-up
'
,
dropDirection
===
'
up
'
).
addClass
(
"
chosen-with-drop
"
);
th
at
.
container
.
toggleClass
(
'
chosen-up
'
,
dropDirection
===
'
up
'
).
addClass
(
"
chosen-with-drop
"
);
th
is
.
winnow_results
(
1
);
th
at
.
winnow_results
(
1
);
return
this
.
form_field_jq
.
trigger
(
"
chosen:showing_dropdown
"
,
{
chosen
:
this
var
maxDropWidth
=
that
.
max_drop_width
;
if
(
maxDropWidth
)
{
var
$drop
=
that
.
container
.
find
(
'
.chosen-drop
'
).
removeClass
(
'
in
'
);
var
maxWidth
=
0
;
$drop
.
find
(
'
.chosen-results>li
'
).
each
(
function
()
{
maxWidth
=
Math
.
max
(
maxWidth
,
$
(
this
).
outerWidth
());
});
$drop
.
css
(
'
width
'
,
Math
.
min
(
maxWidth
+
2
,
maxDropWidth
));
that
.
fixDropWidthTimer
=
setTimeout
(
function
()
{
that
.
fixDropWidthTimer
=
null
;
$drop
.
addClass
(
'
in
'
);
},
50
);
}
return
that
.
form_field_jq
.
trigger
(
"
chosen:showing_dropdown
"
,
{
chosen
:
that
});
};
...
...
@@ -964,15 +988,20 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
};
Chosen
.
prototype
.
results_hide
=
function
()
{
if
(
this
.
results_showing
)
{
this
.
result_clear_highlight
();
this
.
container
.
removeClass
(
"
chosen-with-drop
"
);
this
.
form_field_jq
.
trigger
(
"
chosen:hiding_dropdown
"
,
{
chosen
:
this
var
that
=
this
;
if
(
that
.
fixDropWidthTimer
)
{
clearTimeout
(
that
.
fixDropWidthTimer
);
that
.
fixDropWidthTimer
=
null
;
}
if
(
that
.
results_showing
)
{
that
.
result_clear_highlight
();
that
.
container
.
removeClass
(
"
chosen-with-drop
"
);
that
.
form_field_jq
.
trigger
(
"
chosen:hiding_dropdown
"
,
{
chosen
:
that
});
th
is
.
drop_directionFixed
=
0
;
th
at
.
drop_directionFixed
=
0
;
}
return
th
is
.
results_showing
=
false
;
return
th
at
.
results_showing
=
false
;
};
Chosen
.
prototype
.
set_tab_index
=
function
(
el
)
{
...
...
dist/lib/chosen/chosen.min.css
浏览文件 @
f578c9e9
此差异已折叠。
点击以展开。
dist/lib/chosen/chosen.min.js
浏览文件 @
f578c9e9
此差异已折叠。
点击以展开。
src/js/chosen.js
浏览文件 @
f578c9e9
...
...
@@ -19,6 +19,8 @@
* 3. ‘middle_highlight’ option can make hightlight item in the middle of
* the dropdown menu;
* 4. 'compact_search' option
* 5. 'drop_width' option
* 6. 'max_drop_width' option
* ======================================================================== */
...
...
@@ -208,6 +210,11 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
this
.
compact_search
=
this
.
options
.
compact_search
||
false
;
this
.
inherit_select_classes
=
this
.
options
.
inherit_select_classes
||
false
;
this
.
display_selected_options
=
this
.
options
.
display_selected_options
!=
null
?
this
.
options
.
display_selected_options
:
true
;
var
max_drop_width
=
this
.
options
.
max_drop_width
;
if
(
typeof
max_drop_width
===
'
string
'
&&
max_drop_width
.
indexOf
(
'
px
'
)
===
(
max_drop_width
.
length
-
2
))
{
max_drop_width
=
parseInt
(
max_drop_width
.
substring
(
0
,
max_drop_width
.
length
-
2
));
}
this
.
max_drop_width
=
max_drop_width
;
return
this
.
display_disabled_options
=
this
.
options
.
display_disabled_options
!=
null
?
this
.
options
.
display_disabled_options
:
true
;
};
...
...
@@ -673,6 +680,9 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
if
(
this
.
options
.
drop_width
)
{
this
.
dropdown
.
css
(
'
width
'
,
this
.
options
.
drop_width
).
addClass
(
'
chosen-drop-size-limited
'
);
}
if
(
this
.
max_drop_width
)
{
this
.
dropdown
.
addClass
(
'
chosen-auto-max-width
'
);
}
this
.
results_build
();
this
.
set_tab_index
();
this
.
set_label_behavior
();
...
...
@@ -923,39 +933,53 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
};
Chosen
.
prototype
.
results_show
=
function
()
{
if
(
this
.
is_multiple
&&
this
.
max_selected_options
<=
this
.
choices_count
())
{
this
.
form_field_jq
.
trigger
(
"
chosen:maxselected
"
,
{
var
that
=
this
;
if
(
that
.
is_multiple
&&
that
.
max_selected_options
<=
that
.
choices_count
())
{
that
.
form_field_jq
.
trigger
(
"
chosen:maxselected
"
,
{
chosen
:
this
});
return
false
;
}
th
is
.
results_showing
=
true
;
th
is
.
search_field
.
focus
();
th
is
.
search_field
.
val
(
this
.
search_field
.
val
());
th
at
.
results_showing
=
true
;
th
at
.
search_field
.
focus
();
th
at
.
search_field
.
val
(
that
.
search_field
.
val
());
var
dropDirection
=
this
.
drop_direction
;
if
(
$
.
isFunction
(
dropDirection
))
{
var
dropDirection
=
that
.
drop_direction
;
if
(
$
.
isFunction
(
dropDirection
))
{
dropDirection
=
dropDirection
.
call
(
this
);
}
if
(
dropDirection
===
'
auto
'
)
{
if
(
!
th
is
.
drop_directionFixed
)
{
var
$drop
=
th
is
.
container
.
find
(
'
.chosen-drop
'
);
var
offset
=
th
is
.
container
.
offset
();
if
(
!
th
at
.
drop_directionFixed
)
{
var
$drop
=
th
at
.
container
.
find
(
'
.chosen-drop
'
);
var
offset
=
th
at
.
container
.
offset
();
if
(
offset
.
top
+
$drop
.
outerHeight
()
+
30
>
$
(
window
).
height
()
+
$
(
window
).
scrollTop
())
{
dropDirection
=
'
up
'
;
}
th
is
.
drop_directionFixed
=
dropDirection
;
th
at
.
drop_directionFixed
=
dropDirection
;
}
else
{
dropDirection
=
th
is
.
drop_directionFixed
;
dropDirection
=
th
at
.
drop_directionFixed
;
}
}
th
is
.
container
.
toggleClass
(
'
chosen-up
'
,
dropDirection
===
'
up
'
).
addClass
(
"
chosen-with-drop
"
);
th
at
.
container
.
toggleClass
(
'
chosen-up
'
,
dropDirection
===
'
up
'
).
addClass
(
"
chosen-with-drop
"
);
th
is
.
winnow_results
(
1
);
th
at
.
winnow_results
(
1
);
return
this
.
form_field_jq
.
trigger
(
"
chosen:showing_dropdown
"
,
{
chosen
:
this
var
maxDropWidth
=
that
.
max_drop_width
;
if
(
maxDropWidth
)
{
var
$drop
=
that
.
container
.
find
(
'
.chosen-drop
'
).
removeClass
(
'
in
'
);
var
maxWidth
=
0
;
$drop
.
find
(
'
.chosen-results>li
'
).
each
(
function
()
{
maxWidth
=
Math
.
max
(
maxWidth
,
$
(
this
).
outerWidth
());
});
$drop
.
css
(
'
width
'
,
Math
.
min
(
maxWidth
+
2
,
maxDropWidth
));
that
.
fixDropWidthTimer
=
setTimeout
(
function
()
{
that
.
fixDropWidthTimer
=
null
;
$drop
.
addClass
(
'
in
'
);
},
50
);
}
return
that
.
form_field_jq
.
trigger
(
"
chosen:showing_dropdown
"
,
{
chosen
:
that
});
};
...
...
@@ -964,15 +988,20 @@ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
};
Chosen
.
prototype
.
results_hide
=
function
()
{
if
(
this
.
results_showing
)
{
this
.
result_clear_highlight
();
this
.
container
.
removeClass
(
"
chosen-with-drop
"
);
this
.
form_field_jq
.
trigger
(
"
chosen:hiding_dropdown
"
,
{
chosen
:
this
var
that
=
this
;
if
(
that
.
fixDropWidthTimer
)
{
clearTimeout
(
that
.
fixDropWidthTimer
);
that
.
fixDropWidthTimer
=
null
;
}
if
(
that
.
results_showing
)
{
that
.
result_clear_highlight
();
that
.
container
.
removeClass
(
"
chosen-with-drop
"
);
that
.
form_field_jq
.
trigger
(
"
chosen:hiding_dropdown
"
,
{
chosen
:
that
});
th
is
.
drop_directionFixed
=
0
;
th
at
.
drop_directionFixed
=
0
;
}
return
th
is
.
results_showing
=
false
;
return
th
at
.
results_showing
=
false
;
};
Chosen
.
prototype
.
set_tab_index
=
function
(
el
)
{
...
...
src/js/colorset.js
浏览文件 @
f578c9e9
/*!
* ZUI: Generated from less code - v1.9.0 - 2019-0
3-27
* ZUI: Generated from less code - v1.9.0 - 2019-0
4-25
* http://zui.sexy
* GitHub: https://github.com/easysoft/zui.git
* Copyright (c) 2019 cnezsoft.com; Licensed MIT
...
...
src/less/modules/chosen.less
浏览文件 @
f578c9e9
...
...
@@ -47,6 +47,24 @@
&.chosen-drop-size-limited {
border-top: 1px solid @dropdown-border;
}
&.chosen-auto-max-width {
border-top: 1px solid @dropdown-border;
opacity: 0.5;
min-width: 100%;
> .chosen-results > li {
display: inline-block;
white-space: nowrap;
}
&.in {
opacity: 1;
> .chosen-results > li {
display: block;
white-space: normal;
}
}
}
}
&.chosen-with-drop .chosen-drop {
display: block;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录