BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
b8c43a73
Commit
b8c43a73
authored
Jan 31, 2018
by
Clement Ho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace $.ajax in find file with axios
parent
560c93e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
+11
-13
project_find_file.js
app/assets/javascripts/project_find_file.js
+11
-13
No files found.
app/assets/javascripts/project_find_file.js
View file @
b8c43a73
/* eslint-disable func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, quotes, consistent-return, one-var, one-var-declaration-per-line, no-cond-assign, max-len, object-shorthand, no-param-reassign, comma-dangle, prefer-template, no-unused-vars, no-return-assign */
import
fuzzaldrinPlus
from
'fuzzaldrin-plus'
;
import
axios
from
'~/lib/utils/axios_utils'
;
import
flash
from
'~/flash'
;
import
{
__
}
from
'~/locale'
;
// highlight text(awefwbwgtc -> <b>a</b>wefw<b>b</b>wgt<b>c</b> )
const
highlighter
=
function
(
element
,
text
,
matches
)
{
...
...
@@ -72,19 +75,14 @@ export default class ProjectFindFile {
// files pathes load
load
(
url
)
{
return
$
.
ajax
({
url
:
url
,
method
:
"get"
,
dataType
:
"json"
,
success
:
(
function
(
_this
)
{
return
function
(
data
)
{
_this
.
element
.
find
(
".loading"
).
hide
();
_this
.
filePaths
=
data
;
_this
.
findFile
();
return
_this
.
element
.
find
(
".files-slider tr.tree-item"
).
eq
(
0
).
addClass
(
"selected"
).
focus
();
};
})(
this
)
});
axios
.
get
(
url
)
.
then
(({
data
})
=>
{
this
.
element
.
find
(
'.loading'
).
hide
();
this
.
filePaths
=
data
;
this
.
findFile
();
this
.
element
.
find
(
'.files-slider tr.tree-item'
).
eq
(
0
).
addClass
(
'selected'
).
focus
();
})
.
catch
(()
=>
flash
(
__
(
'An error occurred while loading filenames'
)));
}
// render result
...
...
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