Skip to content
GitLab
Menu
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
2f2a5951
Commit
2f2a5951
authored
Dec 11, 2018
by
Carsten Rose
Browse files
Merge remote-tracking branch 'origin/6345_AlertRework' into 6345_AlertRework
parents
ffc314c2
a3ed9182
Pipeline
#1127
passed with stage
in 2 minutes
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
javascript/src/Alert.js
View file @
2f2a5951
...
...
@@ -113,6 +113,7 @@ var QfqNS = QfqNS || {};
this
.
fadeOutDuration
=
400
;
this
.
timerId
=
null
;
this
.
parent
=
{};
this
.
identifier
=
false
;
this
.
eventEmitter
=
new
EventEmitter
();
};
...
...
@@ -133,9 +134,14 @@ var QfqNS = QfqNS || {};
if
(
!
n
.
QfqPage
.
alertManager
)
{
n
.
QfqPage
.
alertManager
=
new
n
.
AlertManager
({});
}
return
n
.
QfqPage
.
alertManager
;
};
n
.
Alert
.
prototype
.
setIdentifier
=
function
(
i
)
{
this
.
identifier
=
i
;
};
/**
*
* @returns {number|jQuery}
...
...
@@ -225,12 +231,13 @@ var QfqNS = QfqNS || {};
}
this
.
parent
=
this
.
makeAlertContainerSingleton
();
this
.
parent
.
addAlert
(
this
);
if
(
this
.
modal
)
{
this
.
$modalDiv
=
$
(
"
<div>
"
,
{
class
:
"
removeMe
"
});
this
.
parent
.
createBlockScreen
();
this
.
parent
.
createBlockScreen
(
this
);
}
if
(
this
.
messageTitle
)
{
...
...
@@ -325,6 +332,7 @@ var QfqNS = QfqNS || {};
that
.
removeAlertContainer
();
});
}
this
.
parent
.
removeAlert
(
this
.
identifier
);
};
/**
...
...
javascript/src/AlertManager.js
View file @
2f2a5951
...
...
@@ -44,9 +44,18 @@ var QfqNS = QfqNS || {};
*/
n
.
AlertManager
.
prototype
.
addAlert
=
function
(
alert
)
{
this
.
alerts
.
push
(
alert
);
alert
.
setIdentifier
(
this
.
alerts
.
length
);
console
.
log
(
this
.
alerts
);
};
n
.
AlertManager
.
prototype
.
removeAlert
=
function
(
identifier
)
{
for
(
var
i
=
0
;
this
.
alerts
.
length
>
i
;
i
++
)
{
if
(
this
.
alerts
[
i
].
identifier
===
identifier
)
{
this
.
alerts
.
splice
(
i
,
1
);
}
}
};
/**
* Removes the last Alert in the Array. Can be used to safely delete all alerts in a loop.
* Returns false when the AlertManager has no more Alerts.
...
...
@@ -117,11 +126,14 @@ var QfqNS = QfqNS || {};
* that the screen block is removed.
*/
n
.
AlertManager
.
prototype
.
checkAlert
=
function
()
{
if
(
this
.
blockingAlert
.
isShown
)
{
if
(
!
this
.
blockingAlert
.
isShown
)
{
this
.
removeModalAlert
();
}
};
/**
* Remove modal alerts
*/
n
.
AlertManager
.
prototype
.
removeModalAlert
=
function
()
{
if
(
this
.
screenBlocked
)
{
$
(
"
.blockscreenQfq
"
).
remove
();
...
...
Write
Preview
Supports
Markdown
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