You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lychee/js/modules/modal.js

37 lines
699 B

/**
* @name modal.js
* @author Philipp Maurer
* @author Tobias Reich
* @copyright 2013 by Philipp Maurer, Tobias Reich
*
* Modal Module
* Build, show and hide a modal.
*/
modal = {
fns: null,
show: function(title, text, buttons) {
if (!buttons) {
var buttons = [];
buttons[0] = ["", function() {}];
buttons[1] = ["", function() {}];
}
modal.fns = [buttons[0][1], buttons[1][1]];
$("body").append(build.modal(title, text, buttons));
$(".message input").focus();
},
close: function() {
modal.fns = null;
$(".message_overlay").removeClass("fadeIn").css("opacity", 0);
setTimeout(function() { $(".message_overlay").remove() }, 300);
}
}