diff --git a/ui (gen4)/features/core.js b/ui (gen4)/features/core.js index 30a1e76a..ab1b2388 100755 --- a/ui (gen4)/features/core.js +++ b/ui (gen4)/features/core.js @@ -125,7 +125,7 @@ var LifeCycleActions = actions.Actions({ // nw... if(this.__nw_stop_handler && this.runtime == 'nw'){ var gui = requirejs('nw.gui') - gui.Window.get().off('close', this.__nw_stop_handler) + //gui.Window.get().off('close', this.__nw_stop_handler) delete this.__nw_stop_handler } diff --git a/ui (gen4)/features/ui-widgets.js b/ui (gen4)/features/ui-widgets.js index d12ccd74..6f855a9b 100755 --- a/ui (gen4)/features/ui-widgets.js +++ b/ui (gen4)/features/ui-widgets.js @@ -24,6 +24,8 @@ var browse = require('lib/widget/browse') var overlay = require('lib/widget/overlay') var drawer = require('lib/widget/drawer') +var browseWalk = require('lib/widget/browse-walk') + /*********************************************************************/ @@ -467,10 +469,29 @@ var ExternalEditorUIActions = actions.Actions({ } }) + var closingPrevented = false + // XXX STUB: use a top button... // XXX this must not close the overlay... list['Add new editor...'] = function(){ + closingPrevented = true // XXX open 'new editor...' dialog... + var b = overlay.Overlay(that.ribbons.viewer, + browseWalk.makeWalk( + null, '/', + // XXX + '*+(exe|cmd|ps1|sh)', + {}) + // path selected... + .open(function(evt, path){ + // XXX + //this.parent.close() + b.close() + })) + .close(function(){ + o.focus() + }) + return b } // build the dialog... @@ -511,14 +532,19 @@ var ExternalEditorUIActions = actions.Actions({ }], ] }) .open(function(evt){ - o.close() + if(!closingPrevented){ + o.close() + } + closingPrevented = false })) .close(function(){ }) // XXX STUB... + // XXX do this someplace like an update handler (for some + // reason not working yet)... var b = o.client.filter(-1) - + // XXX do this with CSS... b.find('.button').remove() b.find('.text').css({fontStyle: 'italic'}) diff --git a/ui (gen4)/lib/widget/widget.js b/ui (gen4)/lib/widget/widget.js index 71cea681..c5d9c445 100755 --- a/ui (gen4)/lib/widget/widget.js +++ b/ui (gen4)/lib/widget/widget.js @@ -162,6 +162,7 @@ var ContainerPrototype = { options = options || {} this.client = client + client.parent = this // merge options... var opts = Object.create(this.options)