diff --git a/core/scope.js b/core/scope.js index d560ec814248194045a4a0f04c7b5d570010d107..f138f6944c41c7a420d18da9df3ce260b1c634a8 100644 --- a/core/scope.js +++ b/core/scope.js @@ -281,11 +281,14 @@ export default function Scope(wrapper, tlv) { if(def.contains){ if(!def.contains.plane){ def.contains.plane = $('<div>').addClass('subplane').attr('id', `${def.name}_plane`).get(0) + dt.writeTransform(def.contains.plane, { + x: -800, + y: 0 + }) $(plane).append(def.contains.plane) - // add this, as a block, to that link-def ? - } else { - checkView(def.contains) + // add this, as a block, to that link-def ? } + checkView(def.contains) } } } diff --git a/hunks/view.js b/hunks/view.js index 50bd61a3df0c16328f1c00322e7318f6bdbb569c..b781c331dd0d7b0292b0cbee185c15cfb570d57d 100644 --- a/hunks/view.js +++ b/hunks/view.js @@ -1017,9 +1017,9 @@ function View() { let vdef = await this.requestAddHunk('view') // almost definitely the easiest way to handle this is to give our local defs // a .hunk, this way (1) we know they're local - the view will always be local - - await this.requestAddLink(view.outputs[0], link.inputs[1]) - await this.requestAddLink(link.inputs[1], view.outputs[0]) - resolve(view) + await this.requestAddLink(vdef.outputs[0], link.inputs[1]) + await this.requestAddLink(link.inputs[1], vdef.outputs[0]) + resolve(vdef.hunk) } catch (err) { reject(err) } diff --git a/view/blocks.js b/view/blocks.js index da3537cfef55f91abacfcd743a6236384495028a..09dedc62cfd0c9ff0d0e84f3f72207783dde4d15 100644 --- a/view/blocks.js +++ b/view/blocks.js @@ -303,19 +303,19 @@ let rebuildDef = (def, position) => { def.blocks.push(squid) let open = (evt) =>{ // returns the view that connects to this link, - def.context.routelink(def).then((vdef) => { + def.context.routelink(def).then((view) => { console.log('route ok') - // we have vdev.tlv, so, the definition has a handle to the - // top level view, why? + // oddly, + def.contains = view // we *do* want to walk these, so we want a handle to // the view element - not just its def ... - def.contains = vdef.hunk - console.log('"view"', view) - // toggle button state, - $(squid).html('<i class="em em-shell"></i> collapse link') - $(squid).one('click', close) - // nooow... - //view.refresh() + view.refresh().then(() => { + // toggle button state, + $(squid).html('<i class="em em-shell"></i> collapse link') + $(squid).one('click', close) + }).catch((err) => { + console.error(err) + }) }).catch((err) => { console.error(err) })