Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

fix #142 height and width style attribute in html templates #266

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+12 −4
Split
@@ -150,8 +150,7 @@
};
/**
- * This class listens to changes in viewport size and raises an event for templates to
- * refresh.
+ * This class listens to changes in viewport size and raises an event for templates to refresh.
* @singleton
*/
Aria.classDefinition({
@@ -261,8 +260,17 @@
}
width = __getIntSize(width, "width");
height = __getIntSize(height, "height");
- domElt.style.width = (width == null ? '' : width + 'px');
- domElt.style.height = (height == null ? '' : height + 'px');
+ var domStyle = domElt.style;
+ if (width) {
+ domStyle.width = width + 'px';
+ } else if (domStyle.width == '100%') {
+ domStyle.width = '';
+ }
+ if (height) {
+ domStyle.height = height + 'px';
+ } else if (domStyle.height == '100%') {
+ domStyle.height = '';
+ }
// We are not separating overflowX and overflowY here because, in Firefox, a vertical
// scrollbar sometimes appears when using overflowX=hidden without specifying overflowY