I think much of the code in tab.js can be simplified and express succinctly, with the use of tables that map position to functions and to CSS.
For instance, updatePanel always add a new CSS class that corresponds to new position and remove old CSS class that corresponds to oldPosition. So, only two arguments are really needed, if we predefined a mapping from TAB_PANEL_POSITION to TAB_PANEL_STATE_CSS_CLASS.
Another example is onResourceViewerClose(). If there is a mapping from TAB_PANEL_POSITION to onResourceViewerXXX methods, then the method essentially reduces to 7 lines.
I think much of the code in tab.js can be simplified and express succinctly, with the use of tables that map position to functions and to CSS.
For instance, updatePanel always add a new CSS class that corresponds to new position and remove old CSS class that corresponds to oldPosition. So, only two arguments are really needed, if we predefined a mapping from TAB_PANEL_POSITION to TAB_PANEL_STATE_CSS_CLASS.
Another example is onResourceViewerClose(). If there is a mapping from TAB_PANEL_POSITION to onResourceViewerXXX methods, then the method essentially reduces to 7 lines.