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
efb66820
Commit
efb66820
authored
Dec 10, 2016
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add loading message for droplab_ajax
parent
cf3504ed
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
0 deletions
+27
-0
app/assets/javascripts/droplab/droplab_ajax.js
app/assets/javascripts/droplab/droplab_ajax.js
+15
-0
app/assets/javascripts/filtered_search/dropdown_label.js.es6
app/assets/javascripts/filtered_search/dropdown_label.js.es6
+4
-0
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
...ets/javascripts/filtered_search/dropdown_milestone.js.es6
+4
-0
app/assets/stylesheets/framework/filters.scss
app/assets/stylesheets/framework/filters.scss
+4
-0
No files found.
app/assets/javascripts/droplab/droplab_ajax.js
View file @
efb66820
...
...
@@ -23,6 +23,7 @@ require('../window')(function(w){
},
init
:
function
init
(
hook
)
{
var
self
=
this
;
var
config
=
hook
.
config
.
droplabAjax
;
if
(
!
config
||
!
config
.
endpoint
||
!
config
.
method
)
{
...
...
@@ -33,7 +34,21 @@ require('../window')(function(w){
return
;
}
if
(
config
.
loadingTemplate
)
{
var
dynamicList
=
hook
.
list
.
list
.
querySelector
(
'
[data-dynamic]
'
);
var
loadingTemplate
=
document
.
createElement
(
'
div
'
);
loadingTemplate
.
innerHTML
=
config
.
loadingTemplate
;
loadingTemplate
.
setAttribute
(
'
data-loading-template
'
,
true
);
this
.
listTemplate
=
dynamicList
.
outerHTML
;
dynamicList
.
outerHTML
=
loadingTemplate
.
outerHTML
;
}
this
.
_loadUrlData
(
config
.
endpoint
).
then
(
function
(
d
)
{
if
(
config
.
loadingTemplate
)
{
hook
.
list
.
list
.
querySelector
(
'
[data-loading-template]
'
).
outerHTML
=
self
.
listTemplate
;
}
hook
.
list
[
config
.
method
].
call
(
hook
.
list
,
d
);
}).
catch
(
function
(
e
)
{
if
(
e
.
message
)
{
...
...
app/assets/javascripts/filtered_search/dropdown_label.js.es6
View file @
efb66820
...
...
@@ -10,6 +10,10 @@
droplabAjax: {
endpoint: 'labels.json',
method: 'setData',
loadingTemplate: `
<div class="filter-dropdown-loading">
<i class="fa fa-spinner fa-spin"></i>
</div>`,
},
droplabFilter: {
filterFunction: this.filterWithSymbol.bind(this, '~'),
...
...
app/assets/javascripts/filtered_search/dropdown_milestone.js.es6
View file @
efb66820
...
...
@@ -10,6 +10,10 @@
droplabAjax: {
endpoint: 'milestones.json',
method: 'setData',
loadingTemplate: `
<div class="filter-dropdown-loading">
<i class="fa fa-spinner fa-spin"></i>
</div>`,
},
droplabFilter: {
filterFunction: this.filterWithSymbol.bind(this, '%'),
...
...
app/assets/stylesheets/framework/filters.scss
View file @
efb66820
...
...
@@ -121,3 +121,7 @@
.hint-dropdown
{
width
:
250px
;
}
.filter-dropdown-loading
{
padding
:
8px
16px
;
}
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