Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix #142 height and width style attribute in html templates

  • Loading branch information...
commit f3ef544d437f32930f4b9dd17b545da005c33698 1 parent 41b078e
sbehera authored
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/aria/templates/Layout.js
View
16 src/aria/templates/Layout.js
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.