Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
96051549
Commit
96051549
authored
Jul 31, 2016
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically expand hidden discussions when accessed via a permalink hash (closes #19304)
parent
6fb46b60
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
8 deletions
+35
-8
CHANGELOG
CHANGELOG
+1
-0
app/assets/javascripts/behaviors/toggler_behavior.js
app/assets/javascripts/behaviors/toggler_behavior.js
+23
-7
app/assets/javascripts/lib/utils/url_utility.js
app/assets/javascripts/lib/utils/url_utility.js
+11
-1
No files found.
CHANGELOG
View file @
96051549
...
@@ -7,6 +7,7 @@ v 8.12.0 (unreleased)
...
@@ -7,6 +7,7 @@ v 8.12.0 (unreleased)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Optimistic locking for Issues and Merge Requests (title and description overriding prevention)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Add `wiki_page_events` to project hook APIs (Ben Boeckel)
- Add Sentry logging to API calls
- Add Sentry logging to API calls
- Automatically expand hidden discussions when accessed by a permalink !5585 (Mike Greiling)
- Added tests for diff notes
- Added tests for diff notes
- Added 'only_allow_merge_if_build_succeeds' project setting in the API. !5930 (Duck)
- Added 'only_allow_merge_if_build_succeeds' project setting in the API. !5930 (Duck)
...
...
app/assets/javascripts/behaviors/toggler_behavior.js
View file @
96051549
(
function
()
{
(
function
(
w
)
{
$
(
function
()
{
$
(
function
()
{
return
$
(
"
body
"
).
on
(
"
click
"
,
"
.js-toggle-button
"
,
function
(
e
)
{
$
(
'
.js-toggle-button
'
).
on
(
'
click
'
,
function
(
e
)
{
$
(
this
).
find
(
'
i
'
).
toggleClass
(
'
fa fa-chevron-down
'
).
toggleClass
(
'
fa fa-chevron-up
'
);
e
.
preventDefault
();
$
(
this
).
closest
(
"
.js-toggle-container
"
).
find
(
"
.js-toggle-content
"
).
toggle
();
$
(
this
)
return
e
.
preventDefault
();
.
find
(
'
.fa
'
)
.
toggleClass
(
'
fa-chevron-down fa-chevron-up
'
)
.
end
()
.
closest
(
'
.js-toggle-container
'
)
.
find
(
'
.js-toggle-content
'
)
.
toggle
()
;
});
});
});
}).
call
(
this
);
// If we're accessing a permalink, ensure it is not inside a
// closed js-toggle-container!
var
hash
=
w
.
gl
.
utils
.
getLocationHash
();
var
anchor
=
hash
&&
document
.
getElementById
(
hash
);
var
container
=
anchor
&&
$
(
anchor
).
closest
(
'
.js-toggle-container
'
);
if
(
container
&&
container
.
find
(
'
.js-toggle-content
'
).
is
(
'
:hidden
'
))
{
container
.
find
(
'
.js-toggle-button
'
).
trigger
(
'
click
'
);
anchor
.
scrollIntoView
();
}
});
})(
window
);
app/assets/javascripts/lib/utils/url_utility.js
View file @
96051549
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
}
}
return
newUrl
;
return
newUrl
;
};
};
return
w
.
gl
.
utils
.
removeParamQueryString
=
function
(
url
,
param
)
{
w
.
gl
.
utils
.
removeParamQueryString
=
function
(
url
,
param
)
{
var
urlVariables
,
variables
;
var
urlVariables
,
variables
;
url
=
decodeURIComponent
(
url
);
url
=
decodeURIComponent
(
url
);
urlVariables
=
url
.
split
(
'
&
'
);
urlVariables
=
url
.
split
(
'
&
'
);
...
@@ -59,6 +59,16 @@
...
@@ -59,6 +59,16 @@
return
results
;
return
results
;
})()).
join
(
'
&
'
);
})()).
join
(
'
&
'
);
};
};
w
.
gl
.
utils
.
getLocationHash
=
function
(
url
)
{
var
hashIndex
;
if
(
typeof
url
===
'
undefined
'
)
{
// Note: We can't use window.location.hash here because it's
// not consistent across browsers - Firefox will pre-decode it
url
=
window
.
location
.
href
;
}
hashIndex
=
url
.
indexOf
(
'
#
'
);
return
hashIndex
===
-
1
?
null
:
url
.
substring
(
hashIndex
+
1
);
};
})(
window
);
})(
window
);
}).
call
(
this
);
}).
call
(
this
);
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