Browse Source

Fix compactinline opening first navigation item when there are no items

Denis K 8 years ago
parent
commit
e500e3297a
1 changed files with 7 additions and 1 deletions
  1. 7 1
      jet/static/jet/js/src/features/compact-inline.js

+ 7 - 1
jet/static/jet/js/src/features/compact-inline.js

@@ -84,7 +84,13 @@ CompactInline.prototype = {
         $inline.find('.inline-navigation-item[data-inline-related-id="' + $item.attr('id') + '"]').remove();
     },
     openFirstNavigationItem: function($inline) {
-        this.openNavigationItem($inline, $inline.find('.inline-navigation-item').first());
+        var $item = $inline.find('.inline-navigation-item:not(.empty)').first();
+
+        if ($item != undefined) {
+            return;
+        }
+
+        this.openNavigationItem($inline, $item);
         this.scrollNavigationToTop($inline);
     },
     addItemDeleteButton: function($item) {