From: Stephen Burrows Date: Thu, 7 Apr 2011 17:14:35 +0000 (-0400) Subject: Merge branch 'gilbert' into gilbert-1.3 X-Git-Url: http://git.ithinksw.org/philo.git/commitdiff_plain/1eb51a5b5ac85607af67275ff3684febd84406c9?hp=-c Merge branch 'gilbert' into gilbert-1.3 --- 1eb51a5b5ac85607af67275ff3684febd84406c9 diff --combined contrib/gilbert/static/gilbert/plugins/models.js index e952a32,a5b5eed..a5b5eed --- a/contrib/gilbert/static/gilbert/plugins/models.js +++ b/contrib/gilbert/static/gilbert/plugins/models.js @@@ -418,11 -418,13 +418,13 @@@ Gilbert.lib.plugins.models.Plugin = Ext }, create_instance_window: function (model, pk, callback, config, cls) { - var win = this.instance_windows[[model.app_label, model.name, pk]]; - if (win != undefined){ - win.show() - return - } + if (pk != undefined) { + var win = this.instance_windows[[model.app_label, model.name, pk]]; + if (win != undefined){ + win.show(); + return; + }; + }; var pk = pk; var callback = callback; var application = this.application; @@@ -430,7 -432,7 +432,7 @@@ var form_callback = function (form) { var oldform = form; - var win = outer.instance_windows[[model.app_label, model.name, pk]] = application.create_window({ + var win = application.create_window({ layout: 'fit', title: form.title, iconCls: form.iconCls, @@@ -494,9 -496,12 +496,12 @@@ }, ], }); - win.on('close', function(){ - delete outer.instance_windows[[model.app_label, model.name, pk]]; - }); + if (pk != undefined) { + outer.instance_windows[[model.app_label, model.name, pk]] = win + win.on('close', function(){ + delete outer.instance_windows[[model.app_label, model.name, pk]]; + }); + } win.addEvents({ 'saved': true, });