@@ -66,7 +66,9 @@ angular.module('Katello').factory('Nutupane', ['$location', '$http', 'current_or
66
66
data : { } ,
67
67
offset : 0 ,
68
68
visible : true ,
69
+ collapsed : false ,
69
70
detailsVisible : false ,
71
+ newPaneVisible : false ,
70
72
total : 0 ,
71
73
search_string : $location . search ( ) . search ,
72
74
loading_more : false
@@ -178,13 +180,12 @@ angular.module('Katello').factory('Nutupane', ['$location', '$http', 'current_or
178
180
*/
179
181
Nutupane . table . setDetailsVisibility = function ( visibility ) {
180
182
var table = Nutupane . table ;
181
-
182
183
if ( visibility ) {
183
184
// Remove all columns except name and replace them with the details pane
184
185
table . data . columns = shownColums ;
186
+ table . openRightPane ( ) ;
185
187
} else {
186
- // Restore the former columns
187
- table . data . columns = allColumns ;
188
+ table . closeRightPane ( ) ;
188
189
}
189
190
190
191
table . detailsVisible = visibility ;
@@ -203,13 +204,27 @@ angular.module('Katello').factory('Nutupane', ['$location', '$http', 'current_or
203
204
Nutupane . table . newPaneVisible = visibility ;
204
205
} ;
205
206
206
- Nutupane . table . close_item = function ( ) {
207
+ Nutupane . table . close_item = function ( ) {
207
208
Nutupane . table . setDetailsVisibility ( false ) ;
208
- // Restore the former columns
209
- Nutupane . table . data . columns = allColumns ;
210
209
$location . search ( 'item' , '' ) ;
211
210
} ;
212
211
212
+ /**
213
+ * Open the right pane by removing all but the name column.
214
+ */
215
+ Nutupane . table . openRightPane = function ( ) {
216
+ Nutupane . table . collapsed = true ;
217
+ Nutupane . table . data . columns = nameColumn ;
218
+ } ;
219
+
220
+ /**
221
+ * Close the right pane by restoring the table columns.
222
+ */
223
+ Nutupane . table . closeRightPane = function ( ) {
224
+ Nutupane . table . collapsed = false ;
225
+ Nutupane . table . data . columns = allColumns ;
226
+ } ;
227
+
213
228
Nutupane . table . select_item = function ( url , id ) {
214
229
var item ,
215
230
table = Nutupane . table ;
@@ -241,8 +256,7 @@ angular.module('Katello').factory('Nutupane', ['$location', '$http', 'current_or
241
256
table . active_item . selected = true ;
242
257
rowSelect = false ;
243
258
}
244
-
245
- table . active_item . html = response . data ;
259
+ Nutupane . table . active_item . html = response . data ;
246
260
Nutupane . table . setDetailsVisibility ( true ) ;
247
261
} ) ;
248
262
} ;
0 commit comments