forked from leftypol/leftypol
custom alert: now alert will be able to display custom HTML
This commit is contained in:
parent
638931b02d
commit
b55ebcd0ef
10 changed files with 53 additions and 13 deletions
|
@ -69,6 +69,29 @@ var datelocale =
|
|||
, pm: _('pm')
|
||||
};
|
||||
|
||||
|
||||
function alert(a) {
|
||||
var handler, div;
|
||||
var close = function() {
|
||||
handler.fadeOut(400, function() { handler.remove(); });
|
||||
return false;
|
||||
};
|
||||
|
||||
handler = $("<div id='alert_handler'></div>").hide().appendTo('body');
|
||||
|
||||
$("<div id='alert_background'></div>").click(close).appendTo(handler);
|
||||
|
||||
div = $("<div id='alert_div'></div>").appendTo(handler);
|
||||
$("<a id='alert_close' href='javascript:void(0)'><i class='fa fa-times'></i></div>")
|
||||
.click(close).appendTo(div);
|
||||
|
||||
$("<div id='alert_message'></div>").html(a).appendTo(div);
|
||||
|
||||
$("<button class='button alert_button'>"+_("OK")+"</button>").click(close).appendTo(div);
|
||||
|
||||
handler.fadeIn(400);
|
||||
}
|
||||
|
||||
var saved = {};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue