ultimix
windows.js
Go to the documentation of this file.
1 
6 if( !ultimix )
7 {
8  ultimix = {};
9 }
10 
16 if( !ultimix.windows )
17 {
18  ultimix.windows = {};
19 }
20 
32 ultimix.PopupHref = function( URL , Width , Height )
33 {
34  window.open( URL , "" , "width=" + Width + ", height=" + Height );
35 }
36 
42 ultimix.ReloadPage = function()
43 {
44  window.location.reload( true );
45 }
46 
54 ultimix.windows.auto_fit_div = function( Element )
55 {
56  var OtherElements = jQuery( Element ).prevAll();
57  var TotalHeight = jQuery( Element ).parent().innerHeight();
58  var FreeHeight = TotalHeight;
59 
60  for( var i = 0 ; i < OtherElements.length ; i++ )
61  {
62  if( jQuery( OtherElements[ i ] ).is( ':visible' ) )
63  {
64  FreeHeight -= jQuery( OtherElements[ i ] ).outerHeight( true );
65  }
66  }
67 
68  jQuery( Element ).height( 0 );
69  var dHeight = jQuery( Element ).outerHeight() + 2;
70  if( FreeHeight - dHeight > 0 )
71  {
72  jQuery( Element ).height( FreeHeight - dHeight );
73  }
74 }
75 
83 ultimix.windows.regenerate_page = function( PageParameters )
84 {
85  ultimix.data_form.submit_data( PageParameters , false , 'index.php' );
86 }
87 
97 ultimix.windows.regenerate_view = function( PageParameters , DOMSelector )
98 {
99  var DialogId = ultimix.std_dialogs.SimpleWaitingMessageBox();
100 
101  ultimix.ajax_gate.direct_view(
102  PageParameters ,
103  {
104  'success' : function( Result )
105  {
106  jQuery( DOMSelector ).replaceWith( Result );
107  ultimix.std_dialogs.close_message_box( DialogId );
108  }
109  }
110  );
111 }
112 
120 ultimix.windows.regenerate_tab = function( DOMSelector )
121 {
122  eval( 'var PageParameters = ' + jQuery( DOMSelector ).find( '.page_parameters' ).html() );
123 
124  jQuery( DOMSelector ).html( ultimix.std_dialogs.loading_img_widget() );
125 
126  ultimix.ajax_gate.direct_view(
127  PageParameters ,
128  {
129  'success' : function( Result )
130  {
131  var TabId = jQuery( DOMSelector ).attr( 'id' );
132  Result = ultimix.string_utilities.str_replace( '[tab_id]' , TabId , Result );
133  jQuery( DOMSelector ).html( Result );
134  }
135  }
136  );
137 }