Better detection for last open panel
authorCory Chaplin <cory.chaplin@laposte.net>
Wed, 16 Jul 2014 19:19:34 +0000 (21:19 +0200)
committerCory Chaplin <cory.chaplin@laposte.net>
Wed, 16 Jul 2014 19:19:34 +0000 (21:19 +0200)
client/src/views/application.js

index fe9ef3c65b446c8e67cfa5622124f062cf2ed2a7..dd686190610a3b3fa0ce639243cbc5824b8bd9c5 100644 (file)
@@ -383,13 +383,10 @@ _kiwi.view.Application = Backbone.View.extend({
                 panel_access.shift();
 
                 //Get the last-accessed panel model now that we removed the closed one
-                var model = kiwi.connections.active_connection.panels.getByCid(panel_access[0]);
+                var model = _.find(_kiwi.app.panels('applets').concat(_kiwi.app.panels('connections')), {cid: panel_access[0]});
 
                 if (model) {
                     model.view.show();
-                } else {
-                    // This is a workaround because PanelList does not contain applets
-                    kiwi.panels()[0].view.show();
                 }
             }
         });