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
Boxiang Sun
gitlab-ce
Commits
c9045c00
Commit
c9045c00
authored
Oct 23, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes group_avatar & group_label_subscription from global namespace
parent
9931ef4a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
33 deletions
+20
-33
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+5
-4
app/assets/javascripts/group_avatar.js
app/assets/javascripts/group_avatar.js
+12
-19
app/assets/javascripts/group_label_subscription.js
app/assets/javascripts/group_label_subscription.js
+3
-8
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-2
No files found.
app/assets/javascripts/dispatcher.js
View file @
c9045c00
...
@@ -8,7 +8,8 @@
...
@@ -8,7 +8,8 @@
/* global NewBranchForm */
/* global NewBranchForm */
/* global NotificationsForm */
/* global NotificationsForm */
/* global NotificationsDropdown */
/* global NotificationsDropdown */
/* global GroupAvatar */
import
groupAvatar
from
'
./group_avatar
'
;
import
GroupLabelSubscription
from
'
./group_label_subscription
'
;
/* global LineHighlighter */
/* global LineHighlighter */
import
BuildArtifacts
from
'
./build_artifacts
'
;
import
BuildArtifacts
from
'
./build_artifacts
'
;
import
CILintEditor
from
'
./ci_lint_editor
'
;
import
CILintEditor
from
'
./ci_lint_editor
'
;
...
@@ -423,11 +424,11 @@ import Diff from './diff';
...
@@ -423,11 +424,11 @@ import Diff from './diff';
case
'
admin:groups:create
'
:
case
'
admin:groups:create
'
:
BindInOut
.
initAll
();
BindInOut
.
initAll
();
new
Group
();
new
Group
();
new
G
roupAvatar
();
g
roupAvatar
();
break
;
break
;
case
'
groups:edit
'
:
case
'
groups:edit
'
:
case
'
admin:groups:edit
'
:
case
'
admin:groups:edit
'
:
new
G
roupAvatar
();
g
roupAvatar
();
break
;
break
;
case
'
projects:tree:show
'
:
case
'
projects:tree:show
'
:
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
...
@@ -474,7 +475,7 @@ import Diff from './diff';
...
@@ -474,7 +475,7 @@ import Diff from './diff';
const
$el
=
$
(
el
);
const
$el
=
$
(
el
);
if
(
$el
.
find
(
'
.dropdown-group-label
'
).
length
)
{
if
(
$el
.
find
(
'
.dropdown-group-label
'
).
length
)
{
new
gl
.
GroupLabelSubscription
(
$el
);
new
GroupLabelSubscription
(
$el
);
}
else
{
}
else
{
new
gl
.
ProjectLabelSubscription
(
$el
);
new
gl
.
ProjectLabelSubscription
(
$el
);
}
}
...
...
app/assets/javascripts/group_avatar.js
View file @
c9045c00
/* eslint-disable func-names, space-before-function-paren, wrap-iife, quotes, no-var, one-var, one-var-declaration-per-line, no-useless-escape, max-len */
export
default
function
groupAvatar
()
{
$
(
'
.js-choose-group-avatar-button
'
).
on
(
'
click
'
,
function
onClickGroupAvatar
()
{
window
.
GroupAvatar
=
(
function
()
{
const
form
=
$
(
this
).
closest
(
'
form
'
);
function
GroupAvatar
()
{
return
form
.
find
(
'
.js-group-avatar-input
'
).
click
();
$
(
'
.js-choose-group-avatar-button
'
).
on
(
"
click
"
,
function
()
{
var
form
;
form
=
$
(
this
).
closest
(
"
form
"
);
return
form
.
find
(
"
.js-group-avatar-input
"
).
click
();
});
});
$
(
'
.js-group-avatar-input
'
).
on
(
"
change
"
,
function
()
{
$
(
'
.js-group-avatar-input
'
).
on
(
'
change
'
,
function
onChangeAvatarInput
()
{
var
filename
,
form
;
const
form
=
$
(
this
).
closest
(
'
form
'
)
;
form
=
$
(
this
).
closest
(
"
form
"
);
// eslint-disable-next-line no-useless-escape
filename
=
$
(
this
).
val
().
replace
(
/^.*
[\\\/]
/
,
''
);
const
filename
=
$
(
this
).
val
().
replace
(
/^.*
[\\\/]
/
,
''
);
return
form
.
find
(
"
.js-avatar-filename
"
).
text
(
filename
);
return
form
.
find
(
'
.js-avatar-filename
'
).
text
(
filename
);
});
});
}
}
return
GroupAvatar
;
})();
app/assets/javascripts/group_label_subscription.js
View file @
c9045c00
/* eslint-disable func-names, object-shorthand, comma-dangle, wrap-iife, space-before-function-paren, no-param-reassign, max-len */
export
default
class
GroupLabelSubscription
{
class
GroupLabelSubscription
{
constructor
(
container
)
{
constructor
(
container
)
{
const
$container
=
$
(
container
);
const
$container
=
$
(
container
);
this
.
$dropdown
=
$container
.
find
(
'
.dropdown
'
);
this
.
$dropdown
=
$container
.
find
(
'
.dropdown
'
);
...
@@ -18,7 +16,7 @@ class GroupLabelSubscription {
...
@@ -18,7 +16,7 @@ class GroupLabelSubscription {
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
url
:
url
url
,
}).
done
(()
=>
{
}).
done
(()
=>
{
this
.
toggleSubscriptionButtons
();
this
.
toggleSubscriptionButtons
();
this
.
$unsubscribeButtons
.
removeAttr
(
'
data-url
'
);
this
.
$unsubscribeButtons
.
removeAttr
(
'
data-url
'
);
...
@@ -35,7 +33,7 @@ class GroupLabelSubscription {
...
@@ -35,7 +33,7 @@ class GroupLabelSubscription {
$
.
ajax
({
$
.
ajax
({
type
:
'
POST
'
,
type
:
'
POST
'
,
url
:
url
url
,
}).
done
(()
=>
{
}).
done
(()
=>
{
this
.
toggleSubscriptionButtons
();
this
.
toggleSubscriptionButtons
();
});
});
...
@@ -47,6 +45,3 @@ class GroupLabelSubscription {
...
@@ -47,6 +45,3 @@ class GroupLabelSubscription {
this
.
$unsubscribeButtons
.
toggleClass
(
'
hidden
'
);
this
.
$unsubscribeButtons
.
toggleClass
(
'
hidden
'
);
}
}
}
}
window
.
gl
=
window
.
gl
||
{};
window
.
gl
.
GroupLabelSubscription
=
GroupLabelSubscription
;
app/assets/javascripts/main.js
View file @
c9045c00
...
@@ -55,8 +55,6 @@ import './gl_dropdown';
...
@@ -55,8 +55,6 @@ import './gl_dropdown';
import
'
./gl_field_error
'
;
import
'
./gl_field_error
'
;
import
'
./gl_field_errors
'
;
import
'
./gl_field_errors
'
;
import
'
./gl_form
'
;
import
'
./gl_form
'
;
import
'
./group_avatar
'
;
import
'
./group_label_subscription
'
;
import
'
./groups_select
'
;
import
'
./groups_select
'
;
import
'
./header
'
;
import
'
./header
'
;
import
'
./importer_status
'
;
import
'
./importer_status
'
;
...
...
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