Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/binary-window/detached-glass/detached-glass.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ export class DetachedGlass extends Glass {

super({ ...glassOptions, actions });

this.domNode.setAttribute('id', id || genId() + '-F');
// `-D` for "detached"
this.domNode.setAttribute('id', id || genId() + '-D');
this.domNode.setAttribute('detached', '');
// Mirrors the header's `can-drag`: the resize module skips glasses marked
// `can-resize="false"`, so handles never appear on them.
Expand Down
5 changes: 2 additions & 3 deletions src/binary-window/glass/action.detach.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,19 @@ export default {
className: 'bw-action--detach',
onClick: async (event, binaryWindow) => {
const paneEl = event.target.closest('bw-pane');
const paneSashId = paneEl.getAttribute('sash-id');
const glassEl = paneEl.querySelector('bw-glass');

const windowRect = binaryWindow.windowElement.getBoundingClientRect();
const width = windowRect.width - DETACHED_GLASS_INSET * 2;
const height = windowRect.height - DETACHED_GLASS_INSET * 2;

const detachedGlassEl = await binaryWindow.addDetachedGlass({
id: paneSashId + '-F',
position: 'center',
width,
height,
originalGlassElement: glassEl,
});

const paneSashId = paneEl.getAttribute('sash-id');
const paneSash = binaryWindow.rootSash.getById(paneSashId);
const siblingSashId = paneSash.parent.getChildSiblingById(paneSashId).id;

Expand Down