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
iv
gitlab-ce
Commits
f2ad7aab
Commit
f2ad7aab
authored
Mar 22, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use _this instead of self
parent
0a14de84
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
11 deletions
+12
-11
app/assets/javascripts/gl_crop.js.coffee
app/assets/javascripts/gl_crop.js.coffee
+12
-11
No files found.
app/assets/javascripts/gl_crop.js.coffee
View file @
f2ad7aab
...
...
@@ -44,9 +44,9 @@ class GitLabCrop
$
(
selector
,
@
form
)
bindEvents
:
->
self
=
@
_this
=
@
@
fileInput
.
on
'change'
,
(
e
)
->
self
.
onFileInputChange
(
e
,
@
)
_this
.
onFileInputChange
(
e
,
@
)
@
pickImageEl
.
on
'click'
,
@
onPickImageClick
@
modalCrop
.
on
'shown.bs.modal'
,
@
onModalShow
...
...
@@ -54,14 +54,14 @@ class GitLabCrop
@
uploadImageBtn
.
on
'click'
,
@
onUploadImageBtnClick
@
cropActionsBtn
.
on
'click'
,
(
e
)
->
btn
=
@
self
.
onActionBtnClick
(
btn
)
_this
.
onActionBtnClick
(
btn
)
@
croppedImageBlob
=
null
onPickImageClick
:
=>
@
fileInput
.
trigger
(
'click'
)
onModalShow
:
=>
self
=
@
_this
=
@
@
modalCropImg
.
cropper
(
viewMode
:
1
center
:
false
...
...
@@ -78,11 +78,12 @@ class GitLabCrop
cropBoxResizable
:
false
toggleDragModeOnDblclick
:
false
built
:
->
container
=
$
(
@
).
cropper
'getContainerData'
cropBoxWidth
=
self
.
cropBoxWidth
;
cropBoxHeight
=
self
.
cropBoxHeight
;
$image
=
$
(
@
)
container
=
$image
.
cropper
'getContainerData'
cropBoxWidth
=
_this
.
cropBoxWidth
;
cropBoxHeight
=
_this
.
cropBoxHeight
;
$
(
@
)
.
cropper
(
'setCropBoxData'
,
$
image
.
cropper
(
'setCropBoxData'
,
width
:
cropBoxWidth
,
height
:
cropBoxHeight
,
left
:
(
container
.
width
-
cropBoxWidth
)
/
2
,
...
...
@@ -113,11 +114,11 @@ class GitLabCrop
@
readFile
(
input
)
readFile
:
(
input
)
->
self
=
@
_this
=
@
reader
=
new
FileReader
reader
.
onload
=
->
self
.
modalCropImg
.
attr
(
'src'
,
reader
.
result
)
self
.
modalCrop
.
modal
(
'show'
)
_this
.
modalCropImg
.
attr
(
'src'
,
reader
.
result
)
_this
.
modalCrop
.
modal
(
'show'
)
reader
.
readAsDataURL
(
input
.
files
[
0
])
...
...
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