Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dokuwiki
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BRIC
dokuwiki
Commits
2c5ba7b2
Commit
2c5ba7b2
authored
13 years ago
by
Adrian Lang
Browse files
Options
Downloads
Patches
Plain Diff
jQuerify edit section highlighting
parent
eea91219
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/scripts/page.js
+12
-16
12 additions, 16 deletions
lib/scripts/page.js
with
12 additions
and
16 deletions
lib/scripts/page.js
+
12
−
16
View file @
2c5ba7b2
...
...
@@ -19,24 +19,20 @@ dw_page = {
*/
sectionHighlight
:
function
()
{
jQuery
(
'
form.btn_secedit
'
)
.
mouseover
(
function
(
e
){
var
tgt
=
this
.
parentNode
;
var
nr
=
tgt
.
className
.
match
(
/
(\s
+|^
)
editbutton_
(\d
+
)(\s
+|$
)
/
)[
2
];
do
{
tgt
=
tgt
.
previousSibling
;
}
while
(
tgt
!==
null
&&
typeof
tgt
.
tagName
===
'
undefined
'
);
if
(
tgt
===
null
)
return
;
while
(
typeof
tgt
.
className
===
'
undefined
'
||
tgt
.
className
.
match
(
'
(
\\
s+|^)sectionedit
'
+
nr
+
'
(
\\
s+|$)
'
)
===
null
)
{
if
(
typeof
tgt
.
className
!==
'
undefined
'
)
{
jQuery
(
tgt
).
addClass
(
'
section_highlight
'
);
}
tgt
=
(
tgt
.
previousSibling
!==
null
)
?
tgt
.
previousSibling
:
tgt
.
parentNode
;
}
.
mouseover
(
function
(){
var
$tgt
=
jQuery
(
this
).
parent
();
var
nr
=
$tgt
.
attr
(
'
class
'
).
match
(
/
(\s
+|^
)
editbutton_
(\d
+
)(\s
+|$
)
/
)[
2
];
jQuery
(
tgt
).
addClass
(
'
section_highlight
'
);
// Walk the DOM tree up (first previous siblings, then parents)
// until boundary element
while
(
$tgt
.
length
>
0
&&
!
$tgt
.
hasClass
(
'
sectionedit
'
+
nr
))
{
// $.last gives the DOM-ordered last element:
// prev if present, else parent.
$tgt
=
$tgt
.
prev
().
add
(
$tgt
.
parent
()).
last
();
$tgt
.
addClass
(
'
section_highlight
'
);
}
})
.
mouseout
(
function
(
e
){
.
mouseout
(
function
(){
jQuery
(
'
.section_highlight
'
).
removeClass
(
'
section_highlight
'
);
});
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment