webclient.js-i2b2.hive.master_view_ctrlr.js Maven / Gradle / Ivy
/**
* @projectDescription Module used to manage GUI view modes and window "zooming".
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* updated 10-29-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: hive > master view controller');
console.time('execute time');
// Master View Mode controller
// ================================================================================================== //
i2b2.hive.MasterView = {
_validViews: ['Patients', 'Admin', 'Analysis', 'AnalysisZoomed'],
_currentView: false,
_ZoomWindows: [],
eventChangeMode: {},
eventZoomWindows: {},
// ================================================================================================== //
initViewMode: function()
{
var newMode = 'Patients';
var tn = $("viewMode-"+newMode);
if (tn)
{
// remove highlighting from old screen mode links
var old = $$('.selectedView');
old.each(function(el)
{
el.removeClassName('selectedView');
});
// highlight the new screen mode's label
tn.addClassName('selectedView');
}
// update data
this._currentView = newMode;
this.eventInitView.fire( newMode );
return true;
},
// ================================================================================================== //
setViewMode: function(requestedMode) {
if (this._currentView == requestedMode) { return true; }
var newMode = false;
for (var i=0; i