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
fe27de8b
Commit
fe27de8b
authored
Jul 25, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved some code into new files
fixed duplication of code
parent
205090fc
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
41 deletions
+52
-41
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-37
app/assets/javascripts/init_issuable_sidebar.js
app/assets/javascripts/init_issuable_sidebar.js
+16
-0
app/assets/javascripts/init_legacy_filters.js
app/assets/javascripts/init_legacy_filters.js
+14
-0
app/assets/javascripts/init_notes.js
app/assets/javascripts/init_notes.js
+14
-0
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+5
-0
app/assets/javascripts/todos.js
app/assets/javascripts/todos.js
+0
-4
No files found.
app/assets/javascripts/dispatcher.js
View file @
fe27de8b
...
...
@@ -30,7 +30,6 @@
/* global IssuableContext */
/* global IssueStatusSelect */
/* global SubscriptionSelect */
/* global Notes */
import
Issue
from
'
./issue
'
;
import
BindInOut
from
'
./behaviors/bind_in_out
'
;
...
...
@@ -66,6 +65,9 @@ import initSettingsPanels from './settings_panels';
import
initExperimentalFlags
from
'
./experimental_flags
'
;
import
OAuthRememberMe
from
'
./oauth_remember_me
'
;
import
PerformanceBar
from
'
./performance_bar
'
;
import
initNotes
from
'
./init_notes
'
;
import
initLegacyFilters
from
'
./init_legacy_filters
'
;
import
initIssuableSidebar
from
'
./init_issuable_sidebar
'
;
(
function
()
{
var
Dispatcher
;
...
...
@@ -130,42 +132,6 @@ import PerformanceBar from './performance_bar';
.
init
();
}
function
initIssuableSidebar
()
{
new
MilestoneSelect
({
full_path
:
gl
.
sidebarOptions
.
fullPath
,
});
new
LabelsSelect
();
new
IssuableContext
(
gl
.
sidebarOptions
.
currentUser
);
gl
.
Subscription
.
bindAll
(
'
.subscription
'
);
new
gl
.
DueDateSelectors
();
window
.
sidebar
=
new
Sidebar
();
}
function
initLegacyFilters
()
{
new
UsersSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
IssueStatusSelect
();
new
SubscriptionSelect
();
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
gl
.
utils
.
visitUrl
(
`
${
this
.
action
}
&
${
$
(
this
).
serialize
()}
`
);
});
}
function
initNotes
()
{
const
dataEl
=
document
.
querySelector
(
'
.js-notes-data
'
);
const
{
notesUrl
,
notesIds
,
now
,
diffView
,
autocomplete
,
}
=
JSON
.
parse
(
dataEl
.
innerHTML
);
window
.
notes
=
new
Notes
(
notesUrl
,
notesIds
,
now
,
diffView
,
autocomplete
);
}
switch
(
page
)
{
case
'
profiles:preferences:show
'
:
initExperimentalFlags
();
...
...
app/assets/javascripts/init_issuable_sidebar.js
0 → 100644
View file @
fe27de8b
/* eslint-disable no-new */
/* global MilestoneSelect */
/* global LabelsSelect */
/* global IssuableContext */
/* global Sidebar */
export
default
()
=>
{
new
MilestoneSelect
({
full_path
:
gl
.
sidebarOptions
.
fullPath
,
});
new
LabelsSelect
();
new
IssuableContext
(
gl
.
sidebarOptions
.
currentUser
);
gl
.
Subscription
.
bindAll
(
'
.subscription
'
);
new
gl
.
DueDateSelectors
();
window
.
sidebar
=
new
Sidebar
();
};
app/assets/javascripts/init_legacy_filters.js
0 → 100644
View file @
fe27de8b
/* eslint-disable no-new */
/* global UsersSelect */
/* global LabelsSelect */
/* global MilestoneSelect */
/* global IssueStatusSelect */
/* global SubscriptionSelect */
export
default
()
=>
{
new
UsersSelect
();
new
LabelsSelect
();
new
MilestoneSelect
();
new
IssueStatusSelect
();
new
SubscriptionSelect
();
};
app/assets/javascripts/init_notes.js
0 → 100644
View file @
fe27de8b
/* global Notes */
export
default
()
=>
{
const
dataEl
=
document
.
querySelector
(
'
.js-notes-data
'
);
const
{
notesUrl
,
notesIds
,
now
,
diffView
,
autocomplete
,
}
=
JSON
.
parse
(
dataEl
.
innerHTML
);
window
.
notes
=
new
Notes
(
notesUrl
,
notesIds
,
now
,
diffView
,
autocomplete
);
};
app/assets/javascripts/main.js
View file @
fe27de8b
...
...
@@ -346,4 +346,9 @@ $(function () {
gl
.
utils
.
renderTimeago
();
$
(
document
).
trigger
(
'
init.scrolling-tabs
'
);
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
(
event
)
{
event
.
preventDefault
();
gl
.
utils
.
visitUrl
(
`
${
this
.
action
}
&
${
$
(
this
).
serialize
()}
`
);
});
});
app/assets/javascripts/todos.js
View file @
fe27de8b
...
...
@@ -37,10 +37,6 @@ export default class Todos {
this
.
initFilterDropdown
(
$
(
'
.js-type-search
'
),
'
type
'
);
this
.
initFilterDropdown
(
$
(
'
.js-action-search
'
),
'
action_id
'
);
$
(
'
form.filter-form
'
).
on
(
'
submit
'
,
function
applyFilters
(
event
)
{
event
.
preventDefault
();
gl
.
utils
.
visitUrl
(
`
${
this
.
action
}
&
${
$
(
this
).
serialize
()}
`
);
});
return
new
UsersSelect
();
}
...
...
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