mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-28 19:08:50 +00:00
Fix for HelloWorld/ not working when HelloWorld/index.html does.
Closes #483. Reviewed by me.
This commit is contained in:
1 parent
9fd79488f8
commit
eef9549e96
1 file changed
+10
-3
@@ -104,12 +104,19 @@ require("file");
|
||||
}
|
||||
}
|
||||
|
||||
var DOMBaseElement = document.getElementsByTagName("base")[0];
|
||||
var path = window.location.pathname,
|
||||
DOMBaseElement = document.getElementsByTagName("base")[0];
|
||||
|
||||
if (DOMBaseElement)
|
||||
FILE._cwd = FILE.dirname(DOMBaseElement.getAttribute("href"));
|
||||
path = DOMBaseElement.getAttribute("href");
|
||||
|
||||
// If this is a directory, then use it as our relative path.
|
||||
if (path.charAt(path.length - 1) === "/")
|
||||
FILE._cwd = path;
|
||||
|
||||
// If not, use it's parent.
|
||||
else
|
||||
FILE._cwd = FILE.dirname(window.location.pathname);
|
||||
FILE._cwd = FILE.dirname(path);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in new issue
Block a user