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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0421793b
Commit
0421793b
authored
Jan 23, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correctly resets the default template on destroy
parent
99d5838f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
+8
-3
app/assets/javascripts/droplab/droplab_ajax.js
app/assets/javascripts/droplab/droplab_ajax.js
+8
-3
No files found.
app/assets/javascripts/droplab/droplab_ajax.js
View file @
0421793b
...
@@ -29,6 +29,7 @@ require('../window')(function(w){
...
@@ -29,6 +29,7 @@ require('../window')(function(w){
init
:
function
init
(
hook
)
{
init
:
function
init
(
hook
)
{
var
self
=
this
;
var
self
=
this
;
var
config
=
hook
.
config
.
droplabAjax
;
var
config
=
hook
.
config
.
droplabAjax
;
this
.
hook
=
hook
;
if
(
!
config
||
!
config
.
endpoint
||
!
config
.
method
)
{
if
(
!
config
||
!
config
.
endpoint
||
!
config
.
method
)
{
return
;
return
;
...
@@ -52,15 +53,15 @@ require('../window')(function(w){
...
@@ -52,15 +53,15 @@ require('../window')(function(w){
this
.
_loadUrlData
(
config
.
endpoint
)
this
.
_loadUrlData
(
config
.
endpoint
)
.
then
(
function
(
d
)
{
.
then
(
function
(
d
)
{
if
(
config
.
loadingTemplate
)
{
if
(
config
.
loadingTemplate
)
{
var
dataLoadingTemplate
=
hook
.
list
.
list
.
querySelector
(
'
[data-loading-template]
'
);
var
dataLoadingTemplate
=
self
.
hook
.
list
.
list
.
querySelector
(
'
[data-loading-template]
'
);
if
(
dataLoadingTemplate
)
{
if
(
dataLoadingTemplate
)
{
dataLoadingTemplate
.
outerHTML
=
self
.
listTemplate
;
dataLoadingTemplate
.
outerHTML
=
self
.
listTemplate
;
}
}
}
}
if
(
!
hook
.
list
.
hidden
)
{
if
(
!
self
.
hook
.
list
.
hidden
)
{
hook
.
list
[
config
.
method
].
call
(
hook
.
list
,
d
);
self
.
hook
.
list
[
config
.
method
].
call
(
self
.
hook
.
list
,
d
);
}
}
}).
catch
(
function
(
e
)
{
}).
catch
(
function
(
e
)
{
throw
new
droplabAjaxException
(
e
.
message
||
e
);
throw
new
droplabAjaxException
(
e
.
message
||
e
);
...
@@ -68,6 +69,10 @@ require('../window')(function(w){
...
@@ -68,6 +69,10 @@ require('../window')(function(w){
},
},
destroy
:
function
()
{
destroy
:
function
()
{
if
(
this
.
listTemplate
)
{
var
dynamicList
=
this
.
hook
.
list
.
list
.
querySelector
(
'
[data-dynamic]
'
);
dynamicList
.
outerHTML
=
this
.
listTemplate
;
}
}
}
};
};
});
});
...
...
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