Page MenuHomeIn-Portal Phabricator

frame_resizer.js
No OneTemporary

File Metadata

Created
Wed, Feb 26, 7:50 PM

frame_resizer.js

function FrameResizer($show_title, $hide_title, $frameset) {
this.StatusIcon = {0: 'img/list_arrow_desc.gif', 1 : 'img/list_arrow_no.gif'};
this.StatusText = {0: $hide_title, 1 : $show_title};
this.StatusImage = document.getElementById('menu_toggle');
this.Frameset = $frameset;
this.SubFrameset = $frameset.document.getElementById('sub_frameset');
this.TopFrameset = $frameset.document.getElementById('top_frameset');
}
FrameResizer.prototype.InitControls = function ($instance) {
this.StatusImage.onclick = function () {
$instance.FrameToggle();
}
}
FrameResizer.prototype.MenuVisible = function () {
return new RegExp('(.*)' + this.StatusIcon[0] + '$').exec(this.StatusImage.src);
}
FrameResizer.prototype.SetStatus = function ($status) {
this.StatusImage.src = this.StatusIcon[$status];
this.StatusImage.alt = this.StatusText[$status];
this.StatusImage.title = this.StatusText[$status];
document.getElementById('site_logo').style.display = $status ? 'none' : 'block';
}
FrameResizer.prototype.FrameToggle = function () {
if (this.MenuVisible()) {
this.TopFrameset.setAttribute('rows', '25,*');
this.SubFrameset.setAttribute('cols', '0,*');
this.SetStatus(1);
}
else {
this.TopFrameset.setAttribute('rows', this.Frameset.$top_height + ',*');
this.SubFrameset.setAttribute('cols', '200,*');
this.SetStatus(0);
}
}

Event Timeline