4958: Merge branch 'master' into 4958-old-browser-alert
[arvados.git] / apps / workbench / app / assets / javascripts / infinite_scroll.js
index 7bdf574ed9964802d6dab2b011ad3d8ca8b7fd1d..81a3a4639b8c7f63a2b42a416252664d746a6b78 100644 (file)
@@ -225,6 +225,10 @@ $(document).
                 trigger('scroll');
         });
     }).
+    on('shown.bs.tab', 'a[data-toggle="tab"]', function(event) {
+        $(event.target.getAttribute('href') + ' [data-infinite-scroller]').
+            trigger('scroll');
+    }).
     on('click', 'th[data-sort-order]', function() {
         var direction = $(this).data('sort-order-direction');
         // reverse the current direction, or do ascending if none
@@ -241,8 +245,8 @@ $(document).
         // put it in the browser history state if browser allows it
         if( hasHTML5History() ) {
             var tabId = $(this).closest('div.tab-pane').attr('id');
-            var state =  history.state;
-            if( state.order === undefined) {
+            var state =  history.state || {};
+            if( state.order === undefined ) {
                 state.order = {};
             }
             state.order[tabId] = order;