Hide menu on connect, remove rounded edges of clipboard, separate menu hide/show code into own file.

This commit is contained in:
Michael Jumper
2011-11-19 23:05:12 -08:00
parent 8aa228a290
commit cd7ffd4e63
3 changed files with 59 additions and 60 deletions

View File

@@ -0,0 +1,56 @@
var menu_shaded = false;
var shade_interval = null;
var show_interval = null;
function shadeMenu() {
if (!menu_shaded) {
var step = Math.floor(menu.offsetHeight / 5) + 1;
var offset = 0;
menu_shaded = true;
window.clearInterval(show_interval);
shade_interval = window.setInterval(function() {
offset -= step;
menu.style.top = offset + "px";
if (offset <= -menu.offsetHeight) {
window.clearInterval(shade_interval);
menu.style.visiblity = "hidden";
}
}, 30);
}
}
function showMenu() {
if (menu_shaded) {
var step = Math.floor(menu.offsetHeight / 5) + 1;
var offset = -menu.offsetHeight;
menu_shaded = false;
menu.style.visiblity = "";
window.clearInterval(shade_interval);
show_interval = window.setInterval(function() {
offset += step;
if (offset >= 0) {
offset = 0;
window.clearInterval(show_interval);
}
menu.style.top = offset + "px";
}, 30);
}
}