Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 19122c9

Browse files
committed
Merge commit 'bb4f4d0fdaae509cafd467364947717f0c70cb4d' into pflynn/fix-LiveDevMultiBrowser-loop
* commit 'bb4f4d0fdaae509cafd467364947717f0c70cb4d': LiveDevMultiBrowser should properly search parent directories for an index.html.
2 parents dfc9860 + bb4f4d0 commit 19122c9

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

src/LiveDevelopment/LiveDevMultiBrowser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ define(function (require, exports, module) {
417417
// We found no good match
418418
if (i === -1) {
419419
// traverse the directory tree up one level
420-
containingFolder = FileUtils.getDirectoryPath(containingFolder);
420+
containingFolder = FileUtils.getDirectoryPath(FileUtils.stripTrailingSlash(containingFolder));
421421
// Are we still inside the project?
422422
if (containingFolder.indexOf(projectRoot) === -1) {
423423
stillInProjectTree = false;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<html>
2+
<head>
3+
<title>Test</title>
4+
<link rel="stylesheet" href="sub/test.css" />
5+
</head>
6+
<body>
7+
<h1>Hello</h1>
8+
</body>
9+
</html>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
body { background-color: red;}
2+
3+
h1 { color: blue; }

test/spec/LiveDevelopmentMultiBrowser-test.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,18 @@ define(function (require, exports, module) {
102102
});
103103
});
104104

105+
it("should find an index.html in a parent directory", function () {
106+
runs(function () {
107+
waitsForDone(SpecRunnerUtils.openProjectFiles(["sub/test.css"]), "SpecRunnerUtils.openProjectFiles sub/test.css", 1000);
108+
});
109+
110+
waitsForLiveDevelopmentToOpen();
111+
112+
runs(function () {
113+
expect(LiveDevelopment._getCurrentLiveDoc().doc.url).toMatch(/\/index\.html$/);
114+
});
115+
});
116+
105117
it("should send all external stylesheets as related docs on start-up", function () {
106118
var liveDoc;
107119
runs(function () {

0 commit comments

Comments
 (0)