Skip to content
Merged
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
9 changes: 5 additions & 4 deletions src/binary-window/glass/action.minimize.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ export default {
const sillEl = binaryWindow.sillElement;
if (!sillEl) throw new Error(`[bwin] Sill element not found when minimizing`);

const potEl = createDomNode('<button class="bw-pot" bw-plant="glass" />');
sillEl.append(potEl);

const paneEl = event.target.closest('bw-pane');
const glassEl = event.target.closest('bw-glass');
const paneSashId = paneEl.getAttribute('sash-id');
const panePosition = paneEl.getAttribute('position');

binaryWindow.removePane(paneSashId);

// Create the "pot" after `removePane`, which destroys the removed pane's pot
const potEl = createDomNode('<button class="bw-pot" bw-plant="glass" />');
potEl.bwGlassElement = glassEl;
potEl.bwOriginalPosition = panePosition;
potEl.bwOriginalBoundingRect = getMetricsFromElement(paneEl);
potEl.bwOriginalSashId = paneSashId;

binaryWindow.removePane(paneSashId);
sillEl.append(potEl);
},
};