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
Jérome Perrin
gitlab-ce
Commits
8f29c332
Commit
8f29c332
authored
Aug 05, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wrap classes with IIFE and define it inside gl namespace
parent
45454c3c
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
141 additions
and
121 deletions
+141
-121
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+2
-2
app/assets/javascripts/protected_branch_access_dropdown.js.es6
...ssets/javascripts/protected_branch_access_dropdown.js.es6
+21
-16
app/assets/javascripts/protected_branch_create.js.es6
app/assets/javascripts/protected_branch_create.js.es6
+49
-44
app/assets/javascripts/protected_branch_edit.js.es6
app/assets/javascripts/protected_branch_edit.js.es6
+55
-50
app/assets/javascripts/protected_branch_edit_list.js.es6
app/assets/javascripts/protected_branch_edit_list.js.es6
+14
-9
No files found.
app/assets/javascripts/dispatcher.js
View file @
8f29c332
...
@@ -173,8 +173,8 @@
...
@@ -173,8 +173,8 @@
new
Search
();
new
Search
();
break
;
break
;
case
'
projects:protected_branches:index
'
:
case
'
projects:protected_branches:index
'
:
new
ProtectedBranchCreate
();
new
gl
.
ProtectedBranchCreate
();
new
ProtectedBranchEditList
();
new
gl
.
ProtectedBranchEditList
();
break
;
break
;
}
}
switch
(
path
.
first
())
{
switch
(
path
.
first
())
{
...
...
app/assets/javascripts/protected_branch_access_dropdown.js.es6
View file @
8f29c332
class ProtectedBranchAccessDropdown {
(global => {
global.gl = global.gl || {};
gl.ProtectedBranchAccessDropdown = class {
constructor(options) {
constructor(options) {
const { $dropdown, data, onSelect } = options;
const { $dropdown, data, onSelect } = options;
...
@@ -15,4 +18,6 @@ class ProtectedBranchAccessDropdown {
...
@@ -15,4 +18,6 @@ class ProtectedBranchAccessDropdown {
}
}
});
});
}
}
}
}
})(window);
app/assets/javascripts/protected_branch_create.js.es6
View file @
8f29c332
class ProtectedBranchCreate {
(global => {
global.gl = global.gl || {};
gl.ProtectedBranchCreate = class {
constructor() {
constructor() {
this.$wrap = this.$form = $('#new_protected_branch');
this.$wrap = this.$form = $('#new_protected_branch');
this.buildDropdowns();
this.buildDropdowns();
...
@@ -9,7 +12,7 @@ class ProtectedBranchCreate {
...
@@ -9,7 +12,7 @@ class ProtectedBranchCreate {
const $allowedToMergeDropdown = this.$wrap.find('.js-allowed-to-merge');
const $allowedToMergeDropdown = this.$wrap.find('.js-allowed-to-merge');
const $allowedToPushDropdown = this.$wrap.find('.js-allowed-to-push');
const $allowedToPushDropdown = this.$wrap.find('.js-allowed-to-push');
new
ProtectedBranchAccessDropdown({
new gl.
ProtectedBranchAccessDropdown({
$dropdown: $allowedToMergeDropdown,
$dropdown: $allowedToMergeDropdown,
data: gon.merge_access_levels,
data: gon.merge_access_levels,
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
...
@@ -19,7 +22,7 @@ class ProtectedBranchCreate {
...
@@ -19,7 +22,7 @@ class ProtectedBranchCreate {
$allowedToMergeDropdown.data('glDropdown').selectRowAtIndex(0);
$allowedToMergeDropdown.data('glDropdown').selectRowAtIndex(0);
// Allowed to Push dropdown
// Allowed to Push dropdown
new
ProtectedBranchAccessDropdown({
new gl.
ProtectedBranchAccessDropdown({
$dropdown: $allowedToPushDropdown,
$dropdown: $allowedToPushDropdown,
data: gon.push_access_levels,
data: gon.push_access_levels,
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
...
@@ -46,4 +49,6 @@ class ProtectedBranchCreate {
...
@@ -46,4 +49,6 @@ class ProtectedBranchCreate {
this.$form.find('[type="submit"]').removeAttr('disabled');
this.$form.find('[type="submit"]').removeAttr('disabled');
}
}
}
}
}
}
})(window);
app/assets/javascripts/protected_branch_edit.js.es6
View file @
8f29c332
class ProtectedBranchEdit {
(global => {
global.gl = global.gl || {};
gl.ProtectedBranchEdit = class {
constructor(options) {
constructor(options) {
this.$wrap = options.$wrap;
this.$wrap = options.$wrap;
this.$allowedToMergeDropdown = this.$wrap.find('.js-allowed-to-merge');
this.$allowedToMergeDropdown = this.$wrap.find('.js-allowed-to-merge');
...
@@ -10,14 +13,14 @@ class ProtectedBranchEdit {
...
@@ -10,14 +13,14 @@ class ProtectedBranchEdit {
buildDropdowns() {
buildDropdowns() {
// Allowed to merge dropdown
// Allowed to merge dropdown
new
ProtectedBranchAccessDropdown({
new gl.
ProtectedBranchAccessDropdown({
$dropdown: this.$allowedToMergeDropdown,
$dropdown: this.$allowedToMergeDropdown,
data: gon.merge_access_levels,
data: gon.merge_access_levels,
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
});
});
// Allowed to push dropdown
// Allowed to push dropdown
new
ProtectedBranchAccessDropdown({
new gl.
ProtectedBranchAccessDropdown({
$dropdown: this.$allowedToPushDropdown,
$dropdown: this.$allowedToPushDropdown,
data: gon.push_access_levels,
data: gon.push_access_levels,
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
...
@@ -53,4 +56,6 @@ class ProtectedBranchEdit {
...
@@ -53,4 +56,6 @@ class ProtectedBranchEdit {
}
}
});
});
}
}
}
}
})(window);
app/assets/javascripts/protected_branch_edit_list.js.es6
View file @
8f29c332
class ProtectedBranchEditList {
(global => {
global.gl = global.gl || {};
gl.ProtectedBranchEditList = class {
constructor() {
constructor() {
this.$wrap = $('.protected-branches-list');
this.$wrap = $('.protected-branches-list');
// Build edit forms
// Build edit forms
this.$wrap.find('.js-protected-branch-edit-form').each((i, el) => {
this.$wrap.find('.js-protected-branch-edit-form').each((i, el) => {
new
ProtectedBranchEdit({
new gl.
ProtectedBranchEdit({
$wrap: $(el)
$wrap: $(el)
});
});
});
});
}
}
}
}
})(window);
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