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
1fff345e
Commit
1fff345e
authored
Mar 20, 2018
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move confirm_danger_modal bindings directly into the only two pages that need it
parent
43ff14e0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
app/assets/javascripts/confirm_danger_modal.js
app/assets/javascripts/confirm_danger_modal.js
+11
-1
app/assets/javascripts/main.js
app/assets/javascripts/main.js
+0
-9
app/assets/javascripts/pages/groups/edit/index.js
app/assets/javascripts/pages/groups/edit/index.js
+2
-0
app/assets/javascripts/pages/projects/edit/index.js
app/assets/javascripts/pages/projects/edit/index.js
+2
-0
No files found.
app/assets/javascripts/confirm_danger_modal.js
View file @
1fff345e
import
$
from
'
jquery
'
;
import
{
rstrip
}
from
'
./lib/utils/common_utils
'
;
export
default
function
init
ConfirmDangerModal
(
$form
,
text
)
{
function
open
ConfirmDangerModal
(
$form
,
text
)
{
$
(
'
.js-confirm-text
'
).
text
(
text
||
''
);
$
(
'
.js-confirm-danger-input
'
).
val
(
''
);
$
(
'
#modal-confirm-danger
'
).
modal
(
'
show
'
);
...
...
@@ -20,3 +20,13 @@ export default function initConfirmDangerModal($form, text) {
});
$
(
'
.js-confirm-danger-submit
'
).
off
(
'
click
'
).
on
(
'
click
'
,
()
=>
$form
.
submit
());
}
export
default
function
initConfirmDangerModal
()
{
$
(
document
).
on
(
'
click
'
,
'
.js-confirm-danger
'
,
(
e
)
=>
{
e
.
preventDefault
();
const
$btn
=
$
(
e
.
target
);
const
$form
=
$btn
.
closest
(
'
form
'
);
const
text
=
$btn
.
data
(
'
confirmDangerMessage
'
);
openConfirmDangerModal
(
$form
,
text
);
});
}
app/assets/javascripts/main.js
View file @
1fff345e
...
...
@@ -20,7 +20,6 @@ import './behaviors/';
// everything else
import
loadAwardsHandler
from
'
./awards_handler
'
;
import
bp
from
'
./breakpoints
'
;
import
initConfirmDangerModal
from
'
./confirm_danger_modal
'
;
import
Flash
,
{
removeFlashClickListener
}
from
'
./flash
'
;
import
'
./gl_dropdown
'
;
import
initTodoToggle
from
'
./header
'
;
...
...
@@ -213,14 +212,6 @@ document.addEventListener('DOMContentLoaded', () => {
$
(
document
).
trigger
(
'
toggle.comments
'
);
});
$document
.
on
(
'
click
'
,
'
.js-confirm-danger
'
,
(
e
)
=>
{
e
.
preventDefault
();
const
$btn
=
$
(
e
.
target
);
const
$form
=
$btn
.
closest
(
'
form
'
);
const
text
=
$btn
.
data
(
'
confirmDangerMessage
'
);
initConfirmDangerModal
(
$form
,
text
);
});
$document
.
on
(
'
breakpoint:change
'
,
(
e
,
breakpoint
)
=>
{
if
(
breakpoint
===
'
sm
'
||
breakpoint
===
'
xs
'
)
{
const
$gutterIcon
=
$sidebarGutterToggle
.
find
(
'
i
'
);
...
...
app/assets/javascripts/pages/groups/edit/index.js
View file @
1fff345e
import
groupAvatar
from
'
~/group_avatar
'
;
import
TransferDropdown
from
'
~/groups/transfer_dropdown
'
;
import
initConfirmDangerModal
from
'
~/confirm_danger_modal
'
;
document
.
addEventListener
(
'
DOMContentLoaded
'
,
()
=>
{
groupAvatar
();
new
TransferDropdown
();
// eslint-disable-line no-new
initConfirmDangerModal
();
});
app/assets/javascripts/pages/projects/edit/index.js
View file @
1fff345e
import
initSettingsPanels
from
'
~/settings_panels
'
;
import
setupProjectEdit
from
'
~/project_edit
'
;
import
initConfirmDangerModal
from
'
~/confirm_danger_modal
'
;
import
ProjectNew
from
'
../shared/project_new
'
;
import
projectAvatar
from
'
../shared/project_avatar
'
;
import
initProjectPermissionsSettings
from
'
../shared/permissions
'
;
...
...
@@ -11,4 +12,5 @@ document.addEventListener('DOMContentLoaded', () => {
initSettingsPanels
();
projectAvatar
();
initProjectPermissionsSettings
();
initConfirmDangerModal
();
});
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