Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
易企天创
zui
提交
031bb32a
Z
zui
项目概览
易企天创
/
zui
10 个月 前同步成功
通知
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,体验更适合开发者的 AI 搜索 >>
提交
031bb32a
编写于
3月 15, 2017
作者:
C
Catouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
* fix bug #802
http://pms.zentao.net/bug-view-802.html
.
上级
13751ee8
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
36 addition
and
23 deletion
+36
-23
src/js/tooltip.js
src/js/tooltip.js
+36
-23
未找到文件。
src/js/tooltip.js
浏览文件 @
031bb32a
...
...
@@ -30,11 +30,11 @@
// ===============================
var
Tooltip
=
function
(
element
,
options
)
{
this
.
type
=
this
.
options
=
this
.
enabled
=
this
.
timeout
=
this
.
hoverState
=
this
.
type
=
null
this
.
options
=
null
this
.
enabled
=
null
this
.
timeout
=
null
this
.
hoverState
=
null
this
.
$element
=
null
this
.
init
(
'
tooltip
'
,
element
,
options
)
...
...
@@ -144,19 +144,20 @@
var
e
=
$
.
Event
(
'
show.zui.
'
+
this
.
type
)
if
((
content
||
this
.
hasContent
())
&&
this
.
enabled
)
{
this
.
$element
.
trigger
(
e
)
var
that
=
this
that
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
var
$tip
=
th
is
.
tip
()
var
$tip
=
th
at
.
tip
()
th
is
.
setContent
(
content
)
th
at
.
setContent
(
content
)
if
(
th
is
.
options
.
animation
)
$tip
.
addClass
(
'
fade
'
)
if
(
th
at
.
options
.
animation
)
$tip
.
addClass
(
'
fade
'
)
var
placement
=
typeof
th
is
.
options
.
placement
==
'
function
'
?
th
is
.
options
.
placement
.
call
(
this
,
$tip
[
0
],
this
.
$element
[
0
])
:
th
is
.
options
.
placement
var
placement
=
typeof
th
at
.
options
.
placement
==
'
function
'
?
th
at
.
options
.
placement
.
call
(
that
,
$tip
[
0
],
that
.
$element
[
0
])
:
th
at
.
options
.
placement
var
autoToken
=
/
\s?
auto
?\s?
/i
var
autoPlace
=
autoToken
.
test
(
placement
)
...
...
@@ -171,20 +172,20 @@
})
.
addClass
(
placement
)
th
is
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
th
at
.
options
.
container
?
$tip
.
appendTo
(
that
.
options
.
container
)
:
$tip
.
insertAfter
(
that
.
$element
)
var
pos
=
th
is
.
getPosition
()
var
pos
=
th
at
.
getPosition
()
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
if
(
autoPlace
)
{
var
$parent
=
th
is
.
$element
.
parent
()
var
$parent
=
th
at
.
$element
.
parent
()
var
orgPlacement
=
placement
var
docScroll
=
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
var
parentWidth
=
th
is
.
options
.
container
==
'
body
'
?
window
.
innerWidth
:
$parent
.
outerWidth
()
var
parentHeight
=
th
is
.
options
.
container
==
'
body
'
?
window
.
innerHeight
:
$parent
.
outerHeight
()
var
parentLeft
=
th
is
.
options
.
container
==
'
body
'
?
0
:
$parent
.
offset
().
left
var
parentWidth
=
th
at
.
options
.
container
==
'
body
'
?
window
.
innerWidth
:
$parent
.
outerWidth
()
var
parentHeight
=
th
at
.
options
.
container
==
'
body
'
?
window
.
innerHeight
:
$parent
.
outerHeight
()
var
parentLeft
=
th
at
.
options
.
container
==
'
body
'
?
0
:
$parent
.
offset
().
left
placement
=
placement
==
'
bottom
'
&&
pos
.
top
+
pos
.
height
+
actualHeight
-
docScroll
>
parentHeight
?
'
top
'
:
placement
==
'
top
'
&&
pos
.
top
-
docScroll
-
actualHeight
<
0
?
'
bottom
'
:
...
...
@@ -197,10 +198,22 @@
.
addClass
(
placement
)
}
var
calculatedOffset
=
this
.
getCalculatedOffset
(
placement
,
pos
,
actualWidth
,
actualHeight
)
var
calculatedOffset
=
that
.
getCalculatedOffset
(
placement
,
pos
,
actualWidth
,
actualHeight
)
that
.
applyPlacement
(
calculatedOffset
,
placement
)
var
complete
=
function
()
{
var
prevHoverState
=
that
.
hoverState
that
.
$element
.
trigger
(
'
shown.bs.
'
+
that
.
type
)
that
.
hoverState
=
null
this
.
applyPlacement
(
calculatedOffset
,
placement
)
this
.
$element
.
trigger
(
'
shown.zui.
'
+
this
.
type
)
if
(
prevHoverState
==
'
out
'
)
that
.
leave
(
that
)
}
$
.
support
.
transition
&&
that
.
$tip
.
hasClass
(
'
fade
'
)
?
$tip
.
one
(
'
bsTransitionEnd
'
,
complete
)
.
emulateTransitionEnd
(
150
)
:
complete
()
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录