mirror of
https://github.com/Mibew/design.git
synced 2025-01-24 19:10:33 +03:00
baba7b9008
git-svn-id: https://webim.svn.sourceforge.net/svnroot/webim/trunk@404 c66351dc-e62f-0410-b875-e3a5c0b9693f
62 lines
1.2 KiB
JavaScript
62 lines
1.2 KiB
JavaScript
var popupStatus = 0;
|
|
|
|
function loadPopup(){
|
|
if(popupStatus==0){
|
|
$("#backgroundPopup").css({
|
|
"opacity": "0.7"
|
|
});
|
|
$("#backgroundPopup").fadeIn("slow");
|
|
$("#dashlocalesPopup").fadeIn("slow");
|
|
popupStatus = 1;
|
|
}
|
|
}
|
|
function disablePopup(){
|
|
if(popupStatus==1){
|
|
$("#backgroundPopup").fadeOut("slow");
|
|
$("#dashlocalesPopup").fadeOut("slow");
|
|
popupStatus = 0;
|
|
}
|
|
}
|
|
|
|
function normpos(a) {
|
|
if(a < 10) {
|
|
return 10;
|
|
}
|
|
return a;
|
|
}
|
|
|
|
function centerPopup(){
|
|
var windowWidth = document.documentElement.clientWidth;
|
|
var windowHeight = document.documentElement.clientHeight;
|
|
var popupHeight = $("#dashlocalesPopup").height();
|
|
var popupWidth = $("#dashlocalesPopup").width();
|
|
$("#dashlocalesPopup").css({
|
|
"position": "absolute",
|
|
"top": normpos((windowHeight-popupHeight) * 0.2),
|
|
"left": normpos(windowWidth/2-popupWidth/2)
|
|
});
|
|
$("#backgroundPopup").css({
|
|
"height": windowHeight
|
|
});
|
|
}
|
|
|
|
$(function(){
|
|
$("#changelang").click(function(){
|
|
centerPopup();
|
|
loadPopup();
|
|
return false;
|
|
});
|
|
$("#dashlocalesPopupClose").click(function(){
|
|
disablePopup();
|
|
return false;
|
|
});
|
|
$("#backgroundPopup").click(function(){
|
|
disablePopup();
|
|
});
|
|
$(document).keypress(function(e){
|
|
if(e.keyCode==27 && popupStatus==1){
|
|
disablePopup();
|
|
}
|
|
});
|
|
});
|