Skip to content

Instantly share code, notes, and snippets.

@adammiribyan
Created January 9, 2011 12:18
Show Gist options
  • Save adammiribyan/771636 to your computer and use it in GitHub Desktop.
Save adammiribyan/771636 to your computer and use it in GitHub Desktop.
Event.observe(document, 'dom:loaded', function() {
new AdminPane();
});
var AdminPane = Class.create({
initialize: function(){
if ($$('.admin-pane-wrap')[0]){
this.adminPaneWrap = $$('.admin-pane-wrap')[0];
this.adminPaneSwitcher = $$('.admin-pane-switcher')[0];
this.adminPaneWrap.setOpacity('0.9');
this.adminPaneWrap.setStyle({height :document.body.clientHeight + 'px'});
this.adminPaneWrap.observe('click', this.toggle.bind(this));
this.adminPaneSwitcher.observe('click', this.toggle.bind(this));
this.off = true;
}
},
toggle: function(e){
if (this.off) {
this.adminPaneWrap.blindDown();
this.off = false;
}
else
{
this.adminPaneWrap.dropOut();
// this.adminPaneWrap.blindUp();
this.off = true;
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment