]> git.sur5r.net Git - bacula/bacula/blob - gui/baculum/protected/Web/JavaScript/panel-window.js
baculum: Fix incorrect table name error during restore start
[bacula/bacula] / gui / baculum / protected / Web / JavaScript / panel-window.js
1 var PanelWindowClass = jQuery.klass({
2
3         currentWindowId: null,
4         windowIds: ['dashboard', 'container', 'graphs', 'config', 'users'],
5         onShow: null,
6
7         initialize: function() {
8                 this.currentWindowId = this.windowIds[0];
9         },
10
11         hideOthers: function() {
12                 var hide_panel_by_id = function(id) {
13                         var el = $('#' + id);
14
15                         if(el.is(':visible') === true && id != this.currentWindowId) {
16                                 el.slideToggle({
17                                         duration: 300,
18                                         done: function() {
19                                                 el.hide();
20                                         }.bind(el)
21                                 });
22                         }
23                 }.bind(this);
24                 for (var i = 0; i < this.windowIds.length; i++) {
25                         hide_panel_by_id(this.windowIds[i]);
26                 }
27         },
28
29         show: function(id) {
30                 if($('#' + id).is(':visible') === true) {
31                         return;
32                 }
33
34                 this.currentWindowId = id;
35                 $('#' + id).slideToggle({
36                         duration: 400,
37                         start: function() {
38                                 this.hideOthers();
39                         }.bind(this),
40                         done: function() {
41                                 if (this.onShow) {
42                                         this.onShow();
43                                 }
44                                 setContentWidth();
45                         }.bind(this)
46                 });
47         }
48 });
49
50 var PanelWindow;
51 $(function() {
52         PanelWindow = new PanelWindowClass();
53 });