You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by yi...@apache.org on 2018/06/04 15:19:09 UTC

[royale-asjs] branch develop updated: Different way to fix #258. Should it be a pattern for layouts that use absolute positioning of children to make sure the host is not statically positioned?

This is an automated email from the ASF dual-hosted git repository.

yishayw pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 799f187  Different way to fix #258. Should it be a pattern for layouts that use absolute positioning of children to make sure the host is not statically positioned?
799f187 is described below

commit 799f1878250d8c69347f08442c2c333740efdb8d
Author: DESKTOP-RH4S838\Yishay <yi...@hotmail.com>
AuthorDate: Mon Jun 4 18:17:25 2018 +0300

    Different way to fix #258. Should it be a pattern for layouts that use
    absolute positioning of children to make sure the host is not statically
    positioned?
---
 .../royale/TreeExample/src/main/royale/MyInitialView.mxml  |  5 -----
 .../org/apache/royale/html/beads/layouts/TreeGridLayout.as | 14 ++++++++++++++
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml b/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml
index f25bfdf..0dfcef0 100644
--- a/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml
+++ b/examples/royale/TreeExample/src/main/royale/MyInitialView.mxml
@@ -39,11 +39,6 @@ limitations under the License.
 	
 	<fx:Script>
 		<![CDATA[
-		override public function addedToParent():void
-		{
-			super.addedToParent();
-			treeGrid.dispatchEvent(new Event('layoutNeeded'));
-		}
 		]]>
 	</fx:Script>
     
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/layouts/TreeGridLayout.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/layouts/TreeGridLayout.as
index 2de838f..bfa6fb2 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/layouts/TreeGridLayout.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/layouts/TreeGridLayout.as
@@ -34,6 +34,10 @@ package org.apache.royale.html.beads.layouts
 	import org.apache.royale.html.beads.models.TreeGridModel;
 	import org.apache.royale.html.supportClasses.IDataGridColumn;
 	import org.apache.royale.html.supportClasses.TreeGridColumn;
+	COMPILE::JS 
+	{
+		import org.apache.royale.core.IRenderedObject;
+	}
 	
 	/**
 	 * The TreeGridLayout class provides the sizing and positioning for the sub-components
@@ -109,9 +113,19 @@ package org.apache.royale.html.beads.layouts
 		 *  @productversion Royale 0.9
          *  @royaleignorecoercion org.apache.royale.core.IBorderPaddingMarginValuesImpl
          *  @royaleignorecoercion org.apache.royale.core.IUIBase
+         *  @royaleignorecoercion org.apache.royale.core.IRenderedObject
 		 */
 		public function layout():Boolean
 		{
+
+			COMPILE::JS 
+			{
+				var renderedObject:IRenderedObject = IRenderedObject(host);
+				if (!renderedObject.element.style.position || renderedObject.element.style.position == 'static')
+				{
+					renderedObject.element.style.position = 'relative';
+				}
+			}
 			var model:TreeGridModel = uiHost.model as TreeGridModel;
 			var header:ButtonBar = (uiHost.view as TreeGridView).header as ButtonBar;
 			var contentArea:UIBase = (uiHost.view as TreeGridView).listArea;

-- 
To stop receiving notification emails like this one, please contact
yishayw@apache.org.