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
1c8553f2
Commit
1c8553f2
authored
Feb 01, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted notes.js to axios
parent
c09a89c7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+15
-20
No files found.
app/assets/javascripts/notes.js
View file @
1c8553f2
...
@@ -16,6 +16,7 @@ import Autosize from 'autosize';
...
@@ -16,6 +16,7 @@ import Autosize from 'autosize';
import
'
vendor/jquery.caret
'
;
// required by jquery.atwho
import
'
vendor/jquery.caret
'
;
// required by jquery.atwho
import
'
vendor/jquery.atwho
'
;
import
'
vendor/jquery.atwho
'
;
import
AjaxCache
from
'
~/lib/utils/ajax_cache
'
;
import
AjaxCache
from
'
~/lib/utils/ajax_cache
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
{
getLocationHash
}
from
'
./lib/utils/url_utility
'
;
import
{
getLocationHash
}
from
'
./lib/utils/url_utility
'
;
import
Flash
from
'
./flash
'
;
import
Flash
from
'
./flash
'
;
import
CommentTypeToggle
from
'
./comment_type_toggle
'
;
import
CommentTypeToggle
from
'
./comment_type_toggle
'
;
...
@@ -252,26 +253,20 @@ export default class Notes {
...
@@ -252,26 +253,20 @@ export default class Notes {
return
;
return
;
}
}
this
.
refreshing
=
true
;
this
.
refreshing
=
true
;
return
$
.
ajax
({
axios
.
get
(
this
.
notes_url
,
{
url
:
this
.
notes_url
,
headers
:
{
headers
:
{
'
X-Last-Fetched-At
'
:
this
.
last_fetched_at
},
'
X-Last-Fetched-At
'
:
this
.
last_fetched_at
,
dataType
:
'
json
'
,
},
success
:
(
function
(
_this
)
{
}).
then
(({
data
})
=>
{
return
function
(
data
)
{
const
notes
=
data
.
notes
;
var
notes
;
this
.
last_fetched_at
=
data
.
last_fetched_at
;
notes
=
data
.
notes
;
this
.
setPollingInterval
(
data
.
notes
.
length
);
_this
.
last_fetched_at
=
data
.
last_fetched_at
;
$
.
each
(
notes
,
(
i
,
note
)
=>
this
.
renderNote
(
note
));
_this
.
setPollingInterval
(
data
.
notes
.
length
);
return
$
.
each
(
notes
,
function
(
i
,
note
)
{
this
.
refreshing
=
false
;
_this
.
renderNote
(
note
);
}).
catch
(()
=>
{
});
this
.
refreshing
=
false
;
};
});
})(
this
)
}).
always
((
function
(
_this
)
{
return
function
()
{
return
_this
.
refreshing
=
false
;
};
})(
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