This commit is contained in:
2014-12-13 03:18:04 +01:00
parent ae20f82a43
commit 0e4b1a3e6d
24 changed files with 499 additions and 497 deletions

97
jquery/databap.js vendored
View File

@@ -163,100 +163,7 @@ function Databap()
this.initMenu = function()
{
//Hover Event: open/close
self.$menu.hover
(
self.openMenu,
function()
{
closeMenu = true;
if(typeof oMenuTimer != "undefined") clearTimeout(oMenuTimer);
oMenuTimer = setTimeout(self.closeMenu, 1000);
}
);
//Close on click
self.$menu.find('a').click(self.instantCloseMenu);
};
this.openMenu = function()
{
//Disable closing
closeMenu = false;
if(typeof oMenuTimer != "undefined") clearTimeout(oMenuTimer);
//If not already opened / about to open
if(typeof openedMenu == 'undefined' || openedMenu != true)
{
openedMenu = true;
self.$menu.find('#menu_title').hide();
//Main shadow
self.$main.add(self.$title)
.click(self.instantCloseMenu)
.fadeTo('fast', 0.2);
//Switch useless button
self.$menu.find('.useless_button').removeClass('round').addClass('tiny_top_right');
//Move menu items
var iVPos = Math.max(0, $(window).scrollTop() - 46 - 46);
self.$menu.find('#menu_items').css('margin-top', iVPos);
//Expand menu
self.$menu
.stop()
.animate
(
{width:'300px'/*, borderWidth:'10px'*/},
'fast',
function()
{
self.$menu.find('#menu_box').show();
$(this).addClass('opened');
}
);
}
};
this.instantCloseMenu = function()
{
closeMenu=true;
if(typeof oMenuTimer != "undefined") clearTimeout(oMenuTimer);
self.closeMenu();
};
this.closeMenu = function()
{
if(closeMenu == true)
{
if(typeof oMenuTimer != "undefined") clearTimeout(oMenuTimer);
//Switch uselecc button
self.$menu.find('.useless_button').removeClass('tiny_top_right').addClass('round');
//Main shadow
self.$main.add(self.$title)
.off('click')
.fadeTo('fast', 1);
//Reduce menu
self.$menu.find('#menu_box').hide();
self.$menu
.stop()
.animate
(
{width:'20px'/*, borderWidth:'0'*/},
'fast',
function()
{
self.$menu.find('#menu_title').show();
$(this).removeClass('opened');
}
);
openedMenu = false;
closeMenu = false;
}
self.$menu.find('a').each(function(){$(this).attr('title', $(this).find('span').text());});
};
this.setInitEnd = function(bEnded, bAddScrollBar)
@@ -440,7 +347,7 @@ function Databap()
{
iDelta = $Elem.getEmptyHeight();
if(iDelta > 0) $Elem.height('-='+iDelta);
//debug('Removing useless '+iDelta+'px from #'+$Elem.attr('id'));
debug('Removing useless '+iDelta+'px from #'+$Elem.attr('id'));
}
};