Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
node-slate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
Nguyễn Hải Sơn
node-slate
Commits
bdbd7a38
Commit
bdbd7a38
authored
Jun 22, 2014
by
Robert Lord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update app javascript to pass jslint, fixes #80
parent
b147e6a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
search.js
source/javascripts/app/search.js
+2
-2
toc.js
source/javascripts/app/toc.js
+6
-10
No files found.
source/javascripts/app/search.js
View file @
bdbd7a38
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
var
content
,
darkBox
,
searchInfo
;
var
content
,
darkBox
,
searchInfo
;
var
highlightOpts
=
{
element
:
'span'
,
className
:
'search-highlight'
};
var
highlightOpts
=
{
element
:
'span'
,
className
:
'search-highlight'
};
var
index
=
new
lunr
.
Index
;
var
index
=
new
lunr
.
Index
()
;
index
.
ref
(
'id'
);
index
.
ref
(
'id'
);
index
.
field
(
'title'
,
{
boost
:
10
});
index
.
field
(
'title'
,
{
boost
:
10
});
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
// position first element. it wasn't positioned above if len > 1
// position first element. it wasn't positioned above if len > 1
if
(
results
.
length
>
1
)
{
if
(
results
.
length
>
1
)
{
var
firstRef
=
results
[
0
].
ref
;
var
firstRef
=
results
[
0
].
ref
;
var
secondRef
=
results
[
1
].
ref
var
secondRef
=
results
[
1
].
ref
;
refToHeader
(
firstRef
).
insertBefore
(
refToHeader
(
secondRef
));
refToHeader
(
firstRef
).
insertBefore
(
refToHeader
(
secondRef
));
}
}
...
...
source/javascripts/app/toc.js
View file @
bdbd7a38
(
function
(
global
)
{
(
function
(
global
)
{
var
toc
;
global
.
toc
=
toc
;
$
(
toc
);
$
(
animate
);
var
closeToc
=
function
()
{
var
closeToc
=
function
()
{
$
(
".tocify-wrapper"
).
removeClass
(
'open'
);
$
(
".tocify-wrapper"
).
removeClass
(
'open'
);
$
(
"#nav-button"
).
removeClass
(
'open'
);
$
(
"#nav-button"
).
removeClass
(
'open'
);
};
};
function
toc
()
{
var
makeToc
=
function
()
{
toc
=
$
(
"#toc"
).
tocify
({
global
.
toc
=
$
(
"#toc"
).
tocify
({
selectors
:
'h1, h2'
,
selectors
:
'h1, h2'
,
extendPage
:
false
,
extendPage
:
false
,
theme
:
'none'
,
theme
:
'none'
,
...
@@ -37,7 +30,7 @@
...
@@ -37,7 +30,7 @@
$
(
".page-wrapper"
).
click
(
closeToc
);
$
(
".page-wrapper"
).
click
(
closeToc
);
$
(
".tocify-item"
).
click
(
closeToc
);
$
(
".tocify-item"
).
click
(
closeToc
);
}
}
;
// Hack to make already open sections to start opened,
// Hack to make already open sections to start opened,
// instead of displaying an ugly animation
// instead of displaying an ugly animation
...
@@ -47,5 +40,8 @@
...
@@ -47,5 +40,8 @@
},
50
);
},
50
);
}
}
$
(
makeToc
);
$
(
animate
);
})(
window
);
})(
window
);
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