Browse Source

tune confirmPopup()

readme-update
Simon Grim 9 years ago
parent
commit
b2e2ba308c
  1. 4
      css/style.css
  2. 30
      js/interface_common.js
  3. 4
      theme_calm/css/style.css

4
css/style.css

@ -1855,6 +1855,10 @@ ol.toptrends-list { @@ -1855,6 +1855,10 @@ ol.toptrends-list {
*********** CONFIRM POPUP ************
**************************************/
.confirm-popup.prompt-wrapper {
margin-top: -80px;
}
.confirm-popup .message {
text-align: center;
margin: 12px;

30
js/interface_common.js

@ -66,6 +66,7 @@ function closeModalHandler(classBase) { @@ -66,6 +66,7 @@ function closeModalHandler(classBase) {
}
function confirmPopup(event, req) {
if (event && event.stopPropagation)
event.stopPropagation();
var modal = openModal({
@ -79,6 +80,9 @@ function confirmPopup(event, req) { @@ -79,6 +80,9 @@ function confirmPopup(event, req) {
modal.content.find('.message').text(req.messageTxt);
var btn = modal.content.find('.confirm');
if (req.removeConfirm)
btn.remove();
else {
if (req.confirmTxt)
btn.text(req.confirmTxt);
else
@ -90,8 +94,11 @@ function confirmPopup(event, req) { @@ -90,8 +94,11 @@ function confirmPopup(event, req) {
});
} else
btn.on('click', closePrompt);
}
var btn = modal.content.find('.cancel');
if (req.removeCancel)
btn.remove();
else {
if (req.cancelTxt)
btn.text(req.cancelTxt);
else
@ -103,6 +110,27 @@ function confirmPopup(event, req) { @@ -103,6 +110,27 @@ function confirmPopup(event, req) {
});
} else
btn.on('click', closePrompt);
}
var btn = modal.self.find('.prompt-close');
if (req.removeClose)
btn.remove();
else {
if (req.closeFunc) {
if (typeof req.closeFunc === 'string') {
if (req.closeFunc === 'confirmFunc') {
req.closeFunc = req.confirmFunc;
req.closeFuncArgs = req.confirmFuncArgs;
} else if (req.closeFunc === 'cancelFunc') {
req.closeFunc = req.cancelFunc;
req.closeFuncArgs = req.cancelFuncArgs;
}
}
btn.on('click', function () {
closePrompt();
req.closeFunc(req.closeFuncArgs);
});
}
}
}
function checkNetworkStatusAndAskRedirect(cbFunc, cbArg) {

4
theme_calm/css/style.css

@ -2263,6 +2263,10 @@ textarea.splited-post { @@ -2263,6 +2263,10 @@ textarea.splited-post {
*********** CONFIRM POPUP ************
**************************************/
.confirm-popup.prompt-wrapper {
margin-top: -80px;
}
.confirm-popup .message {
text-align: center;
margin: 12px;

Loading…
Cancel
Save