Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
typo3
qfq
Commits
254804d0
Commit
254804d0
authored
Aug 18, 2017
by
bbaer
Browse files
Changes to the alert generation and added btn-group for multiple buttons.
parent
b32db52a
Changes
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/Alert.js
View file @
254804d0
...
...
@@ -130,6 +130,7 @@ var QfqNS = QfqNS || {};
if
(
alertContainer
.
length
===
0
)
{
// No container so far, create one
alertContainer
=
$
(
"
<div>
"
).
attr
(
"
id
"
,
n
.
Alert
.
constants
.
alertContainerId
);
$
(
"
body
"
).
append
(
alertContainer
);
}
...
...
@@ -178,6 +179,7 @@ var QfqNS = QfqNS || {};
*/
n
.
Alert
.
prototype
.
getButtons
=
function
()
{
var
$buttons
=
null
;
var
$container
=
$
(
"
<div>
"
).
addClass
(
"
alert-buttons
"
);
var
numberOfButtons
=
this
.
buttons
.
length
;
var
index
;
var
buttonConfiguration
;
...
...
@@ -186,7 +188,11 @@ var QfqNS = QfqNS || {};
buttonConfiguration
=
this
.
buttons
[
index
];
if
(
!
$buttons
)
{
$buttons
=
$
(
"
<div>
"
).
addClass
(
"
alert-buttons
"
);
if
(
numberOfButtons
>
1
)
{
$buttons
=
$
(
"
<div>
"
).
addClass
(
"
btn-group
"
);
}
else
{
$buttons
=
$container
;
}
}
var
focus
=
buttonConfiguration
.
focus
?
buttonConfiguration
.
focus
:
false
;
...
...
@@ -197,6 +203,11 @@ var QfqNS = QfqNS || {};
.
click
(
buttonConfiguration
,
this
.
buttonHandler
.
bind
(
this
)));
}
if
(
numberOfButtons
>
1
)
{
$container
.
append
(
$buttons
);
$buttons
=
$container
;
}
return
$buttons
;
};
...
...
@@ -215,7 +226,7 @@ var QfqNS = QfqNS || {};
$alertContainer
=
this
.
makeAlertContainerSingleton
();
if
(
this
.
modal
)
{
this
.
$modalDiv
=
$
(
"
<div>
"
);
this
.
$modalDiv
.
css
(
'
width
'
,
Math
.
max
(
document
.
documentElement
.
clientWidth
,
window
.
innerWidth
||
0
)
);
this
.
$modalDiv
.
css
(
'
width
'
,
"
100%
"
);
this
.
$modalDiv
.
css
(
'
height
'
,
Math
.
max
(
document
.
documentElement
.
clientHeight
,
window
.
innerHeight
||
0
));
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment