Skip to content

Commit 4bd8e01

Browse files
committed
alt click opens halo inside of container too
SQUASHED: AUTO-COMMIT-src-client-morphic-selecting.js,AUTO-COMMIT-src-components-tools-lively-container-navbar.js,
1 parent 3f1b8aa commit 4bd8e01

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/client/morphic/selecting.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,26 +109,40 @@ export default class Selecting {
109109
// lively.showElement(e.composedPath()[0],1300).textContent = "path: " + e.composedPath().map(ea => ea.tagName).join(",")
110110

111111

112-
var rootNode = this.findRootNode(document.body)
113112

114113
var path = this.slicePathIfContainerContent(e.composedPath());
115114

116-
// var rootNode = lively.findWorldContext(path)
117115

118116
// workaround weird toplevel event issues... the halo should not get the event
119117
// lively.notify("path " + e.composedPath().map(ea => ea.tagName))
120118
if (e.composedPath().find(ea => ea.tagName == "LIVELY-HALO")) {
121119
path = this.lastPath || e.composedPath()
122120
}
121+
122+
// some inception: deal with containers that should behave as if they are their own document
123+
// if we have found one, treat them as root
124+
var worldContexts = path
125+
.map(ea => lively.findWorldContext(ea))
126+
.filter(ea => ea)
127+
.filter(ea => ea.id == "container-root")
128+
if (worldContexts.length > 0) {
129+
var rootNode = this.findRootNode(worldContexts[0])
130+
} else {
131+
rootNode = this.findRootNode(document.body)
132+
}
133+
123134
this.lastPath = path
124135
path = path
125136
// .reverse()
126137
.filter(ea => ! this.isIgnoredOnMagnify(ea))
127138

139+
140+
128141
if (e.shiftKey) {
129142
var idx = e.composedPath().indexOf(document.body);
130143
path= path
131144
} else {
145+
debugger
132146
// by default: don't go into the shadows
133147
path = path.filter(ea => rootNode === this.findRootNode(ea))
134148
}

src/components/tools/lively-container-navbar.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,6 @@ export default class LivelyContainerNavbar extends Morph {
437437
return ((a.title || a.name) >= (b.title || b.name)) ? 1 : -1;
438438
})
439439
.filter(ea => ! ea.name.match(/^\./));
440-
debugger
441440
files.unshift({name: "..", type: "directory", url: stats.parent});
442441
return files
443442
}

0 commit comments

Comments
 (0)