Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Commit

Permalink
Enhance maximize element action so that it fits/flexes appropriately.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 28, 2014
1 parent dadc0f2 commit 1e4620a
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions elements/x-design-canvas/x-design-canvas.html
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,22 @@
}
},

// 'fit' unless we're inside a core-layout and then 'flex'
maximizeElement: function() {
var r = this.ruleForElement(this.selected);
if (!r) {
var e = this.selected;
if (!e) {
return;
}
r.style.position = 'absolute';
r.style.left = r.style.top = '0px';
r.style.height = r.style.width = '100%';
var r = this.ruleForElement(this.selected);
if (e.parentNode.localName === 'core-layout') {
r.style.position = null;
r.style.left = r.style.top = r.style.width = r.style.height = null;
e.className += ' core-flex';
} else {
r.style.position = 'absolute';
r.style.left = r.style.top = '0px';
r.style.height = r.style.width = '100%';
}
// fire a fake resize event so elements that listen to it
// can update their size
this.fire('resize', {}, window);
Expand Down

0 comments on commit 1e4620a

Please sign in to comment.