Skip to content

Commit 3c96842

Browse files
committed
AE_ Use hooks, improve usability
SQUASHED: AUTO-COMMIT-src-client-lively.js,AUTO-COMMIT-src-client-reactive-active-expression-rewriting-active-expression-rewriting.js,AUTO-COMMIT-src-client-reactive-components-rewritten-aexpr-test-component.js,AUTO-COMMIT-src-client-reactive-components-rewritten-jumping-cubes.js,AUTO-COMMIT-src-client-reactive-components-rewritten-poll.js,AUTO-COMMIT-src-client-utils-stack.js,AUTO-COMMIT-src-client-utils-stack.js.l4a,AUTO-COMMIT-src-components-tools-lively-container.js,AUTO-COMMIT-src-components-widgets-lively-code-mirror.html,AUTO-COMMIT-src-components-widgets-lively-code-mirror.js,
1 parent c069ef0 commit 3c96842

File tree

10 files changed

+332
-132
lines changed

10 files changed

+332
-132
lines changed

src/client/lively.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,7 @@ export default class Lively {
15171517
}
15181518

15191519
// lively.openBrowser("https://lively4/etc/mounts", true, "Github")
1520-
static async openBrowser(url, edit, patternOrPostion, replaceExisting, worldContext) {
1520+
static async openBrowser(url, edit, patternOrPostion, replaceExisting, worldContext, useExisting) {
15211521
worldContext = worldContext || document.body
15221522
if (patternOrPostion && patternOrPostion.line)
15231523
var lineAndColumn = patternOrPostion
@@ -1530,7 +1530,11 @@ export default class Lively {
15301530
var containerPromise;
15311531
if (replaceExisting) {
15321532
livelyContainer = Array.from(worldContext.querySelectorAll("lively-container")).find(ea => ea.isSearchBrowser);
1533+
} else if(useExisting) {
1534+
const containers = Array.from(worldContext.querySelectorAll('lively-container')).filter(c => c.getAttribute('src') === url);
1535+
livelyContainer = containers.find(c => (c.getAttribute('mode') === 'edit') === edit);
15331536
}
1537+
15341538

15351539
var lastWindow = _.first(Array.from(worldContext.querySelectorAll("lively-window"))
15361540
.filter( ea => ea.childNodes[0] && ea.childNodes[0].isSearchBrowser));

0 commit comments

Comments
 (0)