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
cd0825f6
Commit
cd0825f6
authored
Mar 08, 2017
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get view type based on diff_view Cookie
This is because we need to persist the same view type across tabs
parent
a57a0e3d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
app/assets/javascripts/notes.js
app/assets/javascripts/notes.js
+8
-2
No files found.
app/assets/javascripts/notes.js
View file @
cd0825f6
/* eslint-disable no-restricted-properties, func-names, space-before-function-paren, no-var, prefer-rest-params, wrap-iife, no-use-before-define, camelcase, no-unused-expressions, quotes, max-len, one-var, one-var-declaration-per-line, default-case, prefer-template, consistent-return, no-alert, no-return-assign, no-param-reassign, prefer-arrow-callback, no-else-return, comma-dangle, no-new, brace-style, no-lonely-if, vars-on-top, no-unused-vars, no-sequences, no-shadow, newline-per-chained-call, no-useless-escape */
/* global Flash */
/* global Autosave */
/* global Cookies */
/* global ResolveService */
/* global mrRefreshWidgetUrl */
require
(
'
./autosave
'
);
window
.
autosize
=
require
(
'
vendor/autosize
'
);
window
.
Dropzone
=
require
(
'
dropzone
'
);
window
.
Cookies
=
require
(
'
js-cookie
'
);
require
(
'
./dropzone_input
'
);
require
(
'
./gfm_auto_complete
'
);
require
(
'
vendor/jquery.caret
'
);
// required by jquery.atwho
...
...
@@ -42,7 +44,6 @@ require('./task_list');
this
.
notes_url
=
notes_url
;
this
.
note_ids
=
note_ids
;
this
.
last_fetched_at
=
last_fetched_at
;
this
.
view
=
view
;
this
.
noteable_url
=
document
.
URL
;
this
.
notesCountBadge
||
(
this
.
notesCountBadge
=
$
(
"
.issuable-details
"
).
find
(
"
.notes-tab .badge
"
));
this
.
basePollingInterval
=
15000
;
...
...
@@ -57,6 +58,7 @@ require('./task_list');
selector
:
'
.notes
'
});
this
.
collapseLongCommitList
();
this
.
setViewType
(
view
);
// We are in the Merge Requests page so we need another edit form for Changes tab
if
(
gl
.
utils
.
getPagePath
(
1
)
===
'
merge_requests
'
)
{
...
...
@@ -65,6 +67,10 @@ require('./task_list');
}
}
Notes
.
prototype
.
setViewType
=
function
(
view
)
{
this
.
view
=
Cookies
.
get
(
'
diff_view
'
)
||
view
;
};
Notes
.
prototype
.
addBinding
=
function
()
{
// add note to UI after creation
$
(
document
).
on
(
"
ajax:success
"
,
"
.js-main-target-form
"
,
this
.
addNote
);
...
...
@@ -302,7 +308,7 @@ require('./task_list');
};
Notes
.
prototype
.
isParallelView
=
function
()
{
return
this
.
view
===
'
parallel
'
;
return
Cookies
.
get
(
'
diff_view
'
)
===
'
parallel
'
;
};
/*
...
...
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