From c6f3952b819d7a1d549e08cf949db96f8d15c78f Mon Sep 17 00:00:00 2001 From: Matt Schott Date: Tue, 8 May 2012 15:23:29 -0500 Subject: [PATCH 1/5] Fix for popup rendering out of window bounds (top, left) --- source/ui/Popup.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/ui/Popup.js b/source/ui/Popup.js index 45a3de506..7b752f837 100644 --- a/source/ui/Popup.js +++ b/source/ui/Popup.js @@ -87,10 +87,14 @@ enyo.kind({ } }, updatePosition: function() { - if (this.centered) { + if( this.centered ) { var d = this.calcViewportSize(); var b = this.getBounds(); - this.addStyles("top: " + ((d.height-b.height)/2) + "px; left: " + ((d.width-b.width)/2) + "px;"); + + var l = ( ( d.width - b.width ) / 2 ); + var t = ( ( d.height - b.height ) / 2 ); + + this.addStyles( "top: " + ( t >= 0 ? t : 0 ) + "px; left: " + ( l >= 0 ? l : 0 ) + "px;" ); } }, showingChanged: function() { From 7cd30f4cd4039e19e540a0f7f392897def409d0f Mon Sep 17 00:00:00 2001 From: Matt Schott Date: Fri, 18 May 2012 11:02:52 -0500 Subject: [PATCH 2/5] Changed comparison to Math.max() (per azakus suggestion) --- source/ui/Popup.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ui/Popup.js b/source/ui/Popup.js index 7b752f837..0d9a1bebb 100644 --- a/source/ui/Popup.js +++ b/source/ui/Popup.js @@ -94,7 +94,7 @@ enyo.kind({ var l = ( ( d.width - b.width ) / 2 ); var t = ( ( d.height - b.height ) / 2 ); - this.addStyles( "top: " + ( t >= 0 ? t : 0 ) + "px; left: " + ( l >= 0 ? l : 0 ) + "px;" ); + this.addStyles( "top: " + Math.max( t, 0 ) + "px; left: " + Math.max( l, 0 ) + "px;" ); } }, showingChanged: function() { From f1287f9a351a907a5dfb92d7368bccf8936f214f Mon Sep 17 00:00:00 2001 From: Matt Schott Date: Fri, 18 May 2012 11:09:32 -0500 Subject: [PATCH 3/5] Removed single use variables. --- source/ui/Popup.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/source/ui/Popup.js b/source/ui/Popup.js index 4b1833aa1..23ba35c2c 100644 --- a/source/ui/Popup.js +++ b/source/ui/Popup.js @@ -15,7 +15,7 @@ The _autoDismiss_ property controls how a popup may be dismissed. If true (the default), then tapping outside the popup or pressing the ESC key will dismiss the popup. - + The _modal_ property may be set to true to prevent any controls outside the popup from responding to events while the popup is showing. @@ -99,10 +99,7 @@ enyo.kind({ var d = this.calcViewportSize(); var b = this.getBounds(); - var l = ( ( d.width - b.width ) / 2 ); - var t = ( ( d.height - b.height ) / 2 ); - - this.addStyles( "top: " + Math.max( t, 0 ) + "px; left: " + Math.max( l, 0 ) + "px;" ); + this.addStyles( "top: " + Math.max( ( ( d.height - b.height ) / 2 ), 0 ) + "px; left: " + Math.max( ( ( d.width - b.width ) / 2 ), 0 ) + "px;" ); } }, showingChanged: function() { From 42e5f555f6115d0e5347aed23c1849b938197887 Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 18 May 2012 12:22:00 -0700 Subject: [PATCH 4/5] merge in Contro.getComputedStyleValue from jdachtera --- source/dom/Control.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/dom/Control.js b/source/dom/Control.js index 33f994c63..41cce483a 100644 --- a/source/dom/Control.js +++ b/source/dom/Control.js @@ -303,6 +303,12 @@ enyo.kind({ enyo.Control.cssTextToDomStyles(inCssText, this.domStyles); this.domStylesChanged(); }, + getComputedStyleValue: function(inStyle, inDefault) { + if (this.hasNode()) { + return enyo.dom.getComputedStyleValue(this.node, inStyle); + } + return inDefault; + }, domStylesChanged: function() { this.domCssText = enyo.Control.domStylesToCssText(this.domStyles); this.invalidateTags(); From d43ff2d0574b084b60aaf0474c6c7d036183f07b Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Fri, 18 May 2012 13:11:23 -0700 Subject: [PATCH 5/5] Work around IE bug with setting innerHTML on , rerender parent instead + // http://support.microsoft.com/default.aspx?scid=kb;en-us;276228 + if (enyo.platform.ie) { + this.parent.render(); + } else { + this.inherited(arguments); + } + }, //* @public //* Returns the value of the selected option. getValue: function() {