BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1fff345e
Unverified
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
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
10 deletions
+15
-10
confirm_danger_modal.js
app/assets/javascripts/confirm_danger_modal.js
+11
-1
main.js
app/assets/javascripts/main.js
+0
-9
index.js
app/assets/javascripts/pages/groups/edit/index.js
+2
-0
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