Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
core
Commits
4de6b4cc
Commit
4de6b4cc
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
confirmation dialog moved to general admin panel class
parent
c6489b26
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!233
Resolve "Admin panel: "Confirm remove" messages"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend-js/src/main/js/gui/admin/AbstractAdminPanel.js
+28
-4
28 additions, 4 deletions
frontend-js/src/main/js/gui/admin/AbstractAdminPanel.js
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+0
-22
0 additions, 22 deletions
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
with
28 additions
and
26 deletions
frontend-js/src/main/js/gui/admin/AbstractAdminPanel.js
+
28
−
4
View file @
4de6b4cc
...
...
@@ -5,6 +5,7 @@
var
Panel
=
require
(
'
../Panel
'
);
// noinspection JSUnusedLocalSymbols
var
logger
=
require
(
'
../../logger
'
);
var
Functions
=
require
(
'
../../Functions
'
);
var
Promise
=
require
(
"
bluebird
"
);
...
...
@@ -18,15 +19,38 @@ function AbstractAdminPanel(params) {
AbstractAdminPanel
.
prototype
=
Object
.
create
(
Panel
.
prototype
);
AbstractAdminPanel
.
prototype
.
constructor
=
AbstractAdminPanel
;
AbstractAdminPanel
.
prototype
.
_createHeader
=
function
(
name
)
{
AbstractAdminPanel
.
prototype
.
_createHeader
=
function
(
name
)
{
this
.
getElement
().
appendChild
(
Functions
.
createElement
({
type
:
"
h1
"
,
content
:
name
type
:
"
h1
"
,
content
:
name
}));
};
AbstractAdminPanel
.
prototype
.
init
=
function
()
{
AbstractAdminPanel
.
prototype
.
init
=
function
()
{
};
AbstractAdminPanel
.
prototype
.
askConfirmRemoval
=
function
(
params
)
{
return
new
Promise
(
function
(
resolve
)
{
$
(
'
<form><input type="text" style="z-index:10000" name="name"><br></form>
'
).
dialog
({
modal
:
true
,
title
:
params
.
title
,
close
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
status
:
false
});
},
buttons
:
{
'
OK
'
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
reason
:
$
(
'
input[name="name"]
'
).
val
(),
status
:
true
});
},
'
Cancel
'
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
status
:
false
});
}
}
});
})
};
module
.
exports
=
AbstractAdminPanel
;
This diff is collapsed.
Click to expand it.
frontend-js/src/main/js/gui/admin/CommentsAdminPanel.js
+
0
−
22
View file @
4de6b4cc
...
...
@@ -211,27 +211,5 @@ CommentsAdminPanel.prototype.destroy = function () {
}
};
CommentsAdminPanel
.
prototype
.
askConfirmRemoval
=
function
(
params
)
{
return
new
Promise
(
function
(
resolve
)
{
$
(
'
<form><input type="text" style="z-index:10000" name="name"><br></form>
'
).
dialog
({
modal
:
true
,
title
:
params
.
title
,
close
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
status
:
false
});
},
buttons
:
{
'
OK
'
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
reason
:
$
(
'
input[name="name"]
'
).
val
(),
status
:
true
});
},
'
Cancel
'
:
function
()
{
$
(
this
).
dialog
(
'
destroy
'
).
remove
();
resolve
({
status
:
false
});
}
}
});
})
};
module
.
exports
=
CommentsAdminPanel
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment