From 4aa8bf392aeb523c88b4a3c44784aff3868bc419 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 10 Nov 2011 11:17:10 -0800 Subject: [PATCH] not ready for this yet. focusing on one window for now. --- Atom/Classes/AtomApp.m | 21 +++++++++++---------- src/atom/window.coffee | 6 +----- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Atom/Classes/AtomApp.m b/Atom/Classes/AtomApp.m index 55bb27855..72fe546e1 100644 --- a/Atom/Classes/AtomApp.m +++ b/Atom/Classes/AtomApp.m @@ -45,16 +45,17 @@ path = [[[panel URLs] lastObject] path]; } - - for (AtomController *controller in controllers) { - JSValueRef value = [controller.jscocoa callJSFunctionNamed:@"canOpen" withArguments:path, nil]; - if ([controller.jscocoa toBool:value]) { - [controller.jscocoa callJSFunctionNamed:@"open" withArguments:path, nil]; - return; - } - } - - [self createController:path]; + +// Not ready for this yet. window.open calls app.open +// for (AtomController *controller in controllers) { +// JSValueRef value = [controller.jscocoa callJSFunctionNamed:@"canOpen" withArguments:path, nil]; +// if ([controller.jscocoa toBool:value]) { +// [controller.jscocoa callJSFunctionNamed:@"open" withArguments:path, nil]; +// return; +// } +// } + + [self createController:path]; } // Events in the "app:*" namespace get sent to all controllers diff --git a/src/atom/window.coffee b/src/atom/window.coffee index 7c64f249d..c46031319 100644 --- a/src/atom/window.coffee +++ b/src/atom/window.coffee @@ -56,11 +56,7 @@ windowAdditions = atom.trigger arguments... canOpen: (path) -> - parent = @path.replace(/([^\/])$/, "$1/") - child = path.replace(/([^\/])$/, "$1/") - - # If the child is contained by the parent, it can be opened by this window - child.match "^" + parent + false for key, value of windowAdditions console.warn "DOMWindow already has a key named `#{key}`" if window[key]