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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
1a0b6c87
Commit
1a0b6c87
authored
Dec 16, 2020
by
Justin Boyson
Committed by
Paul Slaughter
Dec 16, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Decouple file uploading from initBlob
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/49601
parent
97f3ae0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
11 deletions
+15
-11
app/assets/javascripts/blob_edit/blob_bundle.js
app/assets/javascripts/blob_edit/blob_bundle.js
+13
-9
app/assets/javascripts/pages/projects/show/index.js
app/assets/javascripts/pages/projects/show/index.js
+2
-2
No files found.
app/assets/javascripts/blob_edit/blob_bundle.js
View file @
1a0b6c87
...
...
@@ -38,9 +38,20 @@ const initPopovers = () => {
}
};
export
const
initUploadForm
=
()
=>
{
const
uploadBlobForm
=
$
(
'
.js-upload-blob-form
'
);
if
(
uploadBlobForm
.
length
)
{
const
method
=
uploadBlobForm
.
data
(
'
method
'
);
new
BlobFileDropzone
(
uploadBlobForm
,
method
);
new
NewCommitForm
(
uploadBlobForm
);
disableButtonIfEmptyField
(
uploadBlobForm
.
find
(
'
.js-commit-message
'
),
'
.btn-upload-file
'
);
}
};
export
default
()
=>
{
const
editBlobForm
=
$
(
'
.js-edit-blob-form
'
);
const
uploadBlobForm
=
$
(
'
.js-upload-blob-form
'
);
const
deleteBlobForm
=
$
(
'
.js-delete-blob-form
'
);
if
(
editBlobForm
.
length
)
{
...
...
@@ -80,14 +91,7 @@ export default () => {
window
.
onbeforeunload
=
()
=>
''
;
}
if
(
uploadBlobForm
.
length
)
{
const
method
=
uploadBlobForm
.
data
(
'
method
'
);
new
BlobFileDropzone
(
uploadBlobForm
,
method
);
new
NewCommitForm
(
uploadBlobForm
);
disableButtonIfEmptyField
(
uploadBlobForm
.
find
(
'
.js-commit-message
'
),
'
.btn-upload-file
'
);
}
initUploadForm
();
if
(
deleteBlobForm
.
length
)
{
new
NewCommitForm
(
deleteBlobForm
);
...
...
app/assets/javascripts/pages/projects/show/index.js
View file @
1a0b6c87
import
initTree
from
'
ee_else_ce/repository
'
;
import
initBlob
from
'
~/blob_edit/blob_bundle
'
;
import
{
initUploadForm
}
from
'
~/blob_edit/blob_bundle
'
;
import
ShortcutsNavigation
from
'
~/behaviors/shortcuts/shortcuts_navigation
'
;
import
NotificationsForm
from
'
~/notifications_form
'
;
import
UserCallout
from
'
~/user_callout
'
;
...
...
@@ -26,7 +26,7 @@ new UserCallout({
// Project show page loads different overview content based on user preferences
const
treeSlider
=
document
.
getElementById
(
'
js-tree-list
'
);
if
(
treeSlider
)
{
init
Blob
();
init
UploadForm
();
initTree
();
}
...
...
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