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
Léo-Paul Géneau
gitlab-ce
Commits
261c8e76
Commit
261c8e76
authored
8 years ago
by
Arinde Eniola
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix missing filters on status tab when user swithches to another state
parent
2ed6cd9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
app/assets/javascripts/issues.js.coffee
app/assets/javascripts/issues.js.coffee
+15
-0
app/assets/javascripts/lib/url_utility.js
app/assets/javascripts/lib/url_utility.js
+33
-0
No files found.
app/assets/javascripts/issues.js.coffee
View file @
261c8e76
...
...
@@ -26,6 +26,20 @@
$
(
".selected_issue"
).
bind
"change"
,
Issues
.
checkChanged
# Update state filters if present in page
updateStateFilters
:
->
stateFilters
=
$
(
'.issues-state-filters'
)
newParams
=
{}
paramKeys
=
[
'author_id'
,
'label_name'
,
'milestone_title'
,
'assignee_id'
,
'issue_search'
]
for
paramKey
in
paramKeys
newParams
[
paramKey
]
=
getUrlParameter
(
paramKey
)
or
''
if
stateFilters
.
length
stateFilters
.
find
(
'a'
).
each
->
initialUrl
=
$
(
this
).
attr
'href'
$
(
this
).
attr
'href'
,
mergeUrlParams
(
newParams
,
initialUrl
)
# Make sure we trigger ajax request only after user stop typing
initSearch
:
->
@
timer
=
null
...
...
@@ -54,6 +68,7 @@
# Change url so if user reload a page - search results are saved
history
.
replaceState
{
page
:
issuesUrl
},
document
.
title
,
issuesUrl
Issues
.
reload
()
Issues
.
updateStateFilters
()
dataType
:
"json"
checkChanged
:
->
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/lib/url_utility.js
0 → 100644
View file @
261c8e76
function
getUrlParameter
(
sParam
)
{
var
sPageURL
=
decodeURIComponent
(
window
.
location
.
search
.
substring
(
1
)),
sURLVariables
=
sPageURL
.
split
(
'
&
'
),
sParameterName
,
i
;
for
(
i
=
0
;
i
<
sURLVariables
.
length
;
i
++
)
{
sParameterName
=
sURLVariables
[
i
].
split
(
'
=
'
);
if
(
sParameterName
[
0
]
===
sParam
)
{
return
sParameterName
[
1
]
===
undefined
?
true
:
sParameterName
[
1
];
}
}
}
/**
* @param {Object} params - url keys and value to merge
* @param {String} url
*/
function
mergeUrlParams
(
params
,
url
){
var
newUrl
=
decodeURIComponent
(
url
);
Object
.
keys
(
params
).
forEach
(
function
(
paramName
)
{
var
pattern
=
new
RegExp
(
'
\\
b(
'
+
paramName
+
'
=).*?(&|$)
'
)
if
(
url
.
search
(
pattern
)
>=
0
){
newUrl
=
newUrl
.
replace
(
pattern
,
'
$1
'
+
params
[
paramName
]
+
'
$2
'
);
}
else
{
newUrl
=
newUrl
+
(
newUrl
.
indexOf
(
'
?
'
)
>
0
?
'
&
'
:
'
?
'
)
+
paramName
+
'
=
'
+
params
[
paramName
]
}
});
return
newUrl
;
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
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