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
9f7203ee
Commit
9f7203ee
authored
Nov 14, 2019
by
Utkarsh Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WIP: Remove var from gl_crop.js
parent
fc90f4f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
16 deletions
+11
-16
app/assets/javascripts/profile/gl_crop.js
app/assets/javascripts/profile/gl_crop.js
+11
-16
No files found.
app/assets/javascripts/profile/gl_crop.js
View file @
9f7203ee
...
@@ -59,8 +59,7 @@ import _ from 'underscore';
...
@@ -59,8 +59,7 @@ import _ from 'underscore';
}
}
bindEvents
()
{
bindEvents
()
{
var
_this
;
let
_this
=
this
;
_this
=
this
;
this
.
fileInput
.
on
(
'
change
'
,
function
(
e
)
{
this
.
fileInput
.
on
(
'
change
'
,
function
(
e
)
{
_this
.
onFileInputChange
(
e
,
this
);
_this
.
onFileInputChange
(
e
,
this
);
this
.
value
=
null
;
this
.
value
=
null
;
...
@@ -70,8 +69,7 @@ import _ from 'underscore';
...
@@ -70,8 +69,7 @@ import _ from 'underscore';
this
.
modalCrop
.
on
(
'
hidden.bs.modal
'
,
this
.
onModalHide
);
this
.
modalCrop
.
on
(
'
hidden.bs.modal
'
,
this
.
onModalHide
);
this
.
uploadImageBtn
.
on
(
'
click
'
,
this
.
onUploadImageBtnClick
);
this
.
uploadImageBtn
.
on
(
'
click
'
,
this
.
onUploadImageBtnClick
);
this
.
cropActionsBtn
.
on
(
'
click
'
,
function
()
{
this
.
cropActionsBtn
.
on
(
'
click
'
,
function
()
{
var
btn
;
let
btn
=
this
;
btn
=
this
;
return
_this
.
onActionBtnClick
(
btn
);
return
_this
.
onActionBtnClick
(
btn
);
});
});
return
(
this
.
croppedImageBlob
=
null
);
return
(
this
.
croppedImageBlob
=
null
);
...
@@ -82,8 +80,7 @@ import _ from 'underscore';
...
@@ -82,8 +80,7 @@ import _ from 'underscore';
}
}
onModalShow
()
{
onModalShow
()
{
var
_this
;
let
_this
=
this
;
_this
=
this
;
return
this
.
modalCropImg
.
cropper
({
return
this
.
modalCropImg
.
cropper
({
viewMode
:
1
,
viewMode
:
1
,
center
:
false
,
center
:
false
,
...
@@ -128,8 +125,7 @@ import _ from 'underscore';
...
@@ -128,8 +125,7 @@ import _ from 'underscore';
}
}
onActionBtnClick
(
btn
)
{
onActionBtnClick
(
btn
)
{
var
data
;
const
data
=
$
(
btn
).
data
();
data
=
$
(
btn
).
data
();
if
(
this
.
modalCropImg
.
data
(
'
cropper
'
)
&&
data
.
method
)
{
if
(
this
.
modalCropImg
.
data
(
'
cropper
'
)
&&
data
.
method
)
{
return
this
.
modalCropImg
.
cropper
(
data
.
method
,
data
.
option
);
return
this
.
modalCropImg
.
cropper
(
data
.
method
,
data
.
option
);
}
}
...
@@ -140,9 +136,8 @@ import _ from 'underscore';
...
@@ -140,9 +136,8 @@ import _ from 'underscore';
}
}
readFile
(
input
)
{
readFile
(
input
)
{
var
_this
,
reader
;
let
_this
=
this
;
_this
=
this
;
const
reader
=
new
FileReader
();
reader
=
new
FileReader
();
reader
.
onload
=
()
=>
{
reader
.
onload
=
()
=>
{
_this
.
modalCropImg
.
attr
(
'
src
'
,
reader
.
result
);
_this
.
modalCropImg
.
attr
(
'
src
'
,
reader
.
result
);
return
_this
.
modalCrop
.
modal
(
'
show
'
);
return
_this
.
modalCrop
.
modal
(
'
show
'
);
...
@@ -151,9 +146,10 @@ import _ from 'underscore';
...
@@ -151,9 +146,10 @@ import _ from 'underscore';
}
}
dataURLtoBlob
(
dataURL
)
{
dataURLtoBlob
(
dataURL
)
{
var
array
,
binary
,
i
,
len
;
let
i
=
0
;
binary
=
atob
(
dataURL
.
split
(
'
,
'
)[
1
]);
let
len
=
0
;
array
=
[];
let
binary
=
atob
(
dataURL
.
split
(
'
,
'
)[
1
]);
let
array
=
[];
for
(
i
=
0
,
len
=
binary
.
length
;
i
<
len
;
i
+=
1
)
{
for
(
i
=
0
,
len
=
binary
.
length
;
i
<
len
;
i
+=
1
)
{
array
.
push
(
binary
.
charCodeAt
(
i
));
array
.
push
(
binary
.
charCodeAt
(
i
));
...
@@ -164,9 +160,8 @@ import _ from 'underscore';
...
@@ -164,9 +160,8 @@ import _ from 'underscore';
}
}
setPreview
()
{
setPreview
()
{
var
filename
;
const
filename
=
this
.
fileInput
.
val
().
replace
(
FILENAMEREGEX
,
''
)
;
this
.
previewImage
.
attr
(
'
src
'
,
this
.
dataURL
);
this
.
previewImage
.
attr
(
'
src
'
,
this
.
dataURL
);
filename
=
this
.
fileInput
.
val
().
replace
(
FILENAMEREGEX
,
''
);
return
this
.
filename
.
text
(
filename
);
return
this
.
filename
.
text
(
filename
);
}
}
...
...
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