not ready for this yet. focusing on one window for now.

This commit is contained in:
Chris Wanstrath
2011-11-10 11:17:10 -08:00
parent 89624fcaa4
commit 4aa8bf392a
2 changed files with 12 additions and 15 deletions

View File

@@ -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

View File

@@ -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]