Fix PY-14096 Update code panel correctly
authorValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 10 Oct 2016 12:12:05 +0000 (15:12 +0300)
committerValentina Kiryushkina <valentina.kiryushkina@jetbrains.com>
Mon, 24 Oct 2016 17:09:45 +0000 (20:09 +0300)
python/ipnb/src/org/jetbrains/plugins/ipnb/editor/panels/code/IpnbCodePanel.java

index 270534ecad30ce942c42ddcffa75ed8d36603718..f9a831acffe08c7f14104be4be61356f5820a1c6 100644 (file)
@@ -96,7 +96,7 @@ public class IpnbCodePanel extends IpnbEditablePanel<JComponent, IpnbCodeCell> {
     final Map<String, Object> metadata = myCell.getMetadata();
     if (metadata != null && metadata.containsKey(COLLAPSED_METADATA)) {
       final Boolean isCollapsed = (Boolean)metadata.get(COLLAPSED_METADATA);
-      if (isCollapsed) {
+      if (isCollapsed && !myCell.getCellOutputs().isEmpty()) {
         splitter.setFirstComponent(toggleBar);
         return splitter;
       }
@@ -291,7 +291,9 @@ public class IpnbCodePanel extends IpnbEditablePanel<JComponent, IpnbCodeCell> {
         }
       }
 
-      myViewPanel = createViewPanel();
+      final JComponent panel = createViewPanel();
+      myViewPanel.add(panel);
+
       final IpnbFilePanel filePanel = myParent.getIpnbFilePanel();
       setEditing(false);
       filePanel.revalidateAndRepaint();