Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
6f014b34
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
6f014b34
编写于
7月 09, 2013
作者:
R
Rafael Mendonça França
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11073 from tricknotes/improve-guides-js
Improve guides js
上级
76e95c0c
501e663a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
32 addition
and
36 deletion
+32
-36
guides/assets/javascripts/guides.js
guides/assets/javascripts/guides.js
+30
-34
guides/source/layout.html.erb
guides/source/layout.html.erb
+2
-2
未找到文件。
guides/assets/javascripts/guides.js
浏览文件 @
6f014b34
function
guideMenu
(){
if
(
document
.
getElementById
(
'
guides
'
).
style
.
display
==
"
none
"
)
{
document
.
getElementById
(
'
guides
'
).
style
.
display
=
"
block
"
;
}
else
{
document
.
getElementById
(
'
guides
'
).
style
.
display
=
"
none
"
;
}
}
$
.
fn
.
selectGuide
=
function
(
guide
){
$
.
fn
.
selectGuide
=
function
(
guide
)
{
$
(
"
select
"
,
this
).
val
(
guide
);
}
}
;
guidesIndex
=
{
bind
:
function
(){
var
guidesIndex
=
{
bind
:
function
()
{
var
currentGuidePath
=
window
.
location
.
pathname
;
var
currentGuide
=
currentGuidePath
.
substring
(
currentGuidePath
.
lastIndexOf
(
"
/
"
)
+
1
);
$
(
"
.guides-index-small
"
).
on
(
"
change
"
,
"
select
"
,
guidesIndex
.
navigate
).
selectGuide
(
currentGuide
);
$
(
"
.more-info-button:visible
"
).
click
(
function
(
e
){
$
(
document
).
on
(
"
click
"
,
"
.more-info-button
"
,
function
(
e
){
e
.
stopPropagation
();
if
(
$
(
"
.more-info-links
"
).
is
(
"
:visible
"
))
{
if
(
$
(
"
.more-info-links
"
).
is
(
"
:visible
"
))
{
$
(
"
.more-info-links
"
).
addClass
(
"
s-hidden
"
).
unwrap
();
}
else
{
$
(
"
.more-info-links
"
).
wrap
(
"
<div class='more-info-container'></div>
"
).
removeClass
(
"
s-hidden
"
);
}
$
(
document
).
on
(
"
click
"
,
function
(
e
){
var
$button
=
$
(
"
.more-info-button
"
);
var
element
;
});
$
(
"
#guidesMenu
"
).
on
(
"
click
"
,
function
(
e
)
{
$
(
"
#guides
"
).
toggle
();
return
false
;
});
$
(
document
).
on
(
"
click
"
,
function
(
e
){
e
.
stopPropagation
();
var
$button
=
$
(
"
.more-info-button
"
);
var
element
;
// Cross browser find the element that had the event
if
(
e
.
target
)
element
=
e
.
target
;
else
if
(
e
.
srcElement
)
element
=
e
.
srcElement
;
// Cross browser find the element that had the event
if
(
e
.
target
)
element
=
e
.
target
;
else
if
(
e
.
srcElement
)
element
=
e
.
srcElement
;
// Defeat the older Safari bug:
// http://www.quirksmode.org/js/events_properties.html
if
(
element
.
nodeType
==
3
)
element
=
element
.
parentNode
;
// Defeat the older Safari bug:
// http://www.quirksmode.org/js/events_properties.html
if
(
element
.
nodeType
=
==
3
)
element
=
element
.
parentNode
;
var
$element
=
$
(
element
);
var
$element
=
$
(
element
);
var
$container
=
$element
.
parents
(
"
.more-info-container
"
);
var
$container
=
$element
.
parents
(
"
.more-info-container
"
);
// We've captured a click outside the popup
if
(
$container
.
length
==
0
){
$container
=
$button
.
next
(
"
.more-info-container
"
);
$container
.
find
(
"
.more-info-links
"
).
addClass
(
"
s-hidden
"
).
unwrap
();
$
(
document
).
off
(
"
click
"
);
}
});
// We've captured a click outside the popup
if
(
$container
.
length
===
0
){
$container
=
$button
.
next
(
"
.more-info-container
"
);
$container
.
find
(
"
.more-info-links
"
).
addClass
(
"
s-hidden
"
).
unwrap
();
}
});
},
navigate
:
function
(
e
){
var
$list
=
$
(
e
.
target
);
url
=
$list
.
val
();
var
url
=
$list
.
val
();
window
.
location
=
url
;
}
}
}
;
guides/source/layout.html.erb
浏览文件 @
6f014b34
...
...
@@ -48,7 +48,7 @@
<ul
class=
"nav"
>
<li><a
class=
"nav-item"
href=
"index.html"
>
Home
</a></li>
<li
class=
"guides-index guides-index-large"
>
<a
href=
"index.html"
onclick=
"guideMenu(); return false;"
id=
"guidesMenu"
class=
"guides-index-item nav-item"
>
Guides Index
</a>
<a
href=
"index.html"
id=
"guidesMenu"
class=
"guides-index-item nav-item"
>
Guides Index
</a>
<div
id=
"guides"
class=
"clearfix"
style=
"display: none;"
>
<hr
/>
<%
[
'L'
,
'R'
].
each
do
|
position
|
%>
...
...
@@ -143,7 +143,7 @@
<script
type=
"text/javascript"
src=
"javascripts/syntaxhighlighter/shBrushSql.js"
></script>
<script
type=
"text/javascript"
src=
"javascripts/syntaxhighlighter/shBrushPlain.js"
></script>
<script
type=
"text/javascript"
>
SyntaxHighlighter
.
all
()
SyntaxHighlighter
.
all
()
;
$
(
guidesIndex
.
bind
);
</script>
</body>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录