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
2d41c3f5
Commit
2d41c3f5
authored
Oct 05, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restore inexplicably removed code from requestFileSuccess.
(also clean up a few global refs)
parent
b6d52a6f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
11 deletions
+18
-11
app/assets/javascripts/blob/template_selector.js.es6
app/assets/javascripts/blob/template_selector.js.es6
+9
-2
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+2
-2
app/assets/javascripts/templates/issuable_template_selector.js.es6
...s/javascripts/templates/issuable_template_selector.js.es6
+1
-1
app/assets/javascripts/templates/issuable_template_selectors.js.es6
.../javascripts/templates/issuable_template_selectors.js.es6
+6
-6
No files found.
app/assets/javascripts/blob/template_selector.js.es6
View file @
2d41c3f5
...
@@ -68,8 +68,15 @@
...
@@ -68,8 +68,15 @@
// To be implemented on the extending class
// To be implemented on the extending class
// e.g.
// e.g.
// Api.gitignoreText item.name, @requestFileSuccess.bind(@)
// Api.gitignoreText item.name, @requestFileSuccess.bind(@)
requestFileSuccess(file, skipFocus) {
requestFileSuccess(file, { skipFocus, append } = {}) {
this.editor.setValue(file.content, 1);
const oldValue = this.editor.getValue();
let newValue = file.content;
if (append && oldValue.length && oldValue !== newValue) {
newValue = oldValue + '\n\n' + newValue;
}
this.editor.setValue(newValue, 1);
if (!skipFocus) this.editor.focus();
if (!skipFocus) this.editor.focus();
if (this.editor instanceof jQuery) {
if (this.editor instanceof jQuery) {
...
...
app/assets/javascripts/dispatcher.js
View file @
2d41c3f5
...
@@ -59,7 +59,7 @@
...
@@ -59,7 +59,7 @@
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
new
GLForm
(
$
(
'
.issue-form
'
));
new
GLForm
(
$
(
'
.issue-form
'
));
new
IssuableForm
(
$
(
'
.issue-form
'
));
new
IssuableForm
(
$
(
'
.issue-form
'
));
new
IssuableTemplateSelectors
();
new
gl
.
IssuableTemplateSelectors
();
break
;
break
;
case
'
projects:merge_requests:new
'
:
case
'
projects:merge_requests:new
'
:
case
'
projects:merge_requests:edit
'
:
case
'
projects:merge_requests:edit
'
:
...
@@ -67,7 +67,7 @@
...
@@ -67,7 +67,7 @@
shortcut_handler
=
new
ShortcutsNavigation
();
shortcut_handler
=
new
ShortcutsNavigation
();
new
GLForm
(
$
(
'
.merge-request-form
'
));
new
GLForm
(
$
(
'
.merge-request-form
'
));
new
IssuableForm
(
$
(
'
.merge-request-form
'
));
new
IssuableForm
(
$
(
'
.merge-request-form
'
));
new
IssuableTemplateSelectors
();
new
gl
.
IssuableTemplateSelectors
();
break
;
break
;
case
'
projects:tags:new
'
:
case
'
projects:tags:new
'
:
new
ZenMode
();
new
ZenMode
();
...
...
app/assets/javascripts/templates/issuable_template_selector.js.es6
View file @
2d41c3f5
...
@@ -50,4 +50,4 @@
...
@@ -50,4 +50,4 @@
}
}
global.IssuableTemplateSelector = IssuableTemplateSelector;
global.IssuableTemplateSelector = IssuableTemplateSelector;
})(window);
})(window
.gl || (window.gl = {})
);
app/assets/javascripts/templates/issuable_template_selectors.js.es6
View file @
2d41c3f5
((global) => {
((global) => {
class IssuableTemplateSelectors {
class IssuableTemplateSelectors {
constructor(
opts
= {}) {
constructor(
{ $dropdowns, editor }
= {}) {
this.$dropdowns =
opts.
$dropdowns || $('.js-issuable-selector');
this.$dropdowns = $dropdowns || $('.js-issuable-selector');
this.editor =
opts.
editor || this.initEditor();
this.editor = editor || this.initEditor();
this.$dropdowns.each((i, dropdown) => {
this.$dropdowns.each((i, dropdown) => {
le
t $dropdown = $(dropdown);
cons
t $dropdown = $(dropdown);
new IssuableTemplateSelector({
new
gl.
IssuableTemplateSelector({
pattern: /(\.md)/,
pattern: /(\.md)/,
data: $dropdown.data('data'),
data: $dropdown.data('data'),
wrapper: $dropdown.closest('.js-issuable-selector-wrap'),
wrapper: $dropdown.closest('.js-issuable-selector-wrap'),
...
@@ -26,4 +26,4 @@
...
@@ -26,4 +26,4 @@
}
}
global.IssuableTemplateSelectors = IssuableTemplateSelectors;
global.IssuableTemplateSelectors = IssuableTemplateSelectors;
})(window);
})(window
.gl || (window.gl = {})
);
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