royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From carlosrov...@apache.org
Subject [royale-asjs] branch develop updated: add Jewel ViewPort to get rid of hardcoded syles in class that mess with CSS styles and make Jewel ScrollingViewport use classNames as well
Date Sun, 02 Sep 2018 11:23:08 GMT
This is an automated email from the ASF dual-hosted git repository.

carlosrovira 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 71108b8  add Jewel ViewPort to get rid of hardcoded syles in class that mess with
CSS styles and make Jewel ScrollingViewport use classNames as well
71108b8 is described below

commit 71108b89f4e1e48e50812b06299e51aaf5a09b33
Author: Carlos Rovira <carlosrovira@apache.org>
AuthorDate: Sun Sep 2 13:23:03 2018 +0200

    add Jewel ViewPort to get rid of hardcoded syles in class that mess with CSS styles and
make Jewel ScrollingViewport use classNames as well
---
 .../projects/Jewel/src/main/resources/defaults.css | 13 +++-
 .../projects/Jewel/src/main/royale/JewelClasses.as |  3 +-
 .../apache/royale/jewel/supportClasses/Viewport.as | 70 ++++++++++++++++++++++
 .../supportClasses/scrollbar/ScrollingViewport.as  |  9 ++-
 .../projects/Jewel/src/main/sass/_global.sass      |  4 +-
 .../sass/components/_applicationmaincontent.sass   |  2 +-
 .../Jewel/src/main/sass/components/_layout.sass    |  6 ++
 7 files changed, 98 insertions(+), 9 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/resources/defaults.css b/frameworks/projects/Jewel/src/main/resources/defaults.css
index ba0581b..fc5e59d 100644
--- a/frameworks/projects/Jewel/src/main/resources/defaults.css
+++ b/frameworks/projects/Jewel/src/main/resources/defaults.css
@@ -78,7 +78,7 @@ j|VGroup {
 
 j|Container {
   IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView");
-  IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport");
+  IViewport: ClassReference("org.apache.royale.jewel.supportClasses.Viewport");
   IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
 }
 
@@ -94,7 +94,7 @@ j|DataContainer {
   IDataProviderItemRendererMapper: ClassReference("org.apache.royale.jewel.beads.itemRenderers.DataItemRendererFactoryForCollectionView");
   IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory");
   IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.StringItemRenderer");
-  IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport");
+  IViewport: ClassReference("org.apache.royale.jewel.supportClasses.Viewport");
   IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
 }
 
@@ -616,6 +616,13 @@ j|Label {
   IBeadModel: ClassReference("org.apache.royale.jewel.beads.models.TextModel");
 }
 
+.viewport {
+  overflow: hidden;
+}
+.viewport.scroll {
+  overflow: auto;
+}
+
 .layout.absolute {
   position: absolute;
 }
@@ -3348,7 +3355,7 @@ j|TitleBar {
 
 j|ApplicationMainContent {
   IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView");
-  IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport");
+  IViewport: ClassReference("org.apache.royale.jewel.supportClasses.Viewport");
   IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel");
 }
 
diff --git a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
index 3db51db..203db01 100644
--- a/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
+++ b/frameworks/projects/Jewel/src/main/royale/JewelClasses.as
@@ -82,9 +82,10 @@ package
         import org.apache.royale.jewel.supportClasses.IActivable; IActivable;
         import org.apache.royale.jewel.supportClasses.textinput.ITextInput; ITextInput;
 
+        import org.apache.royale.jewel.supportClasses.Viewport; Viewport;
+        import org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport; ScrollingViewport;
         import org.apache.royale.jewel.supportClasses.datagrid.DataGridColumn; DataGridColumn;
         import org.apache.royale.jewel.supportClasses.datechooser.DateChooserTable; DateChooserTable;
-        import org.apache.royale.jewel.supportClasses.scrollbar.ScrollingViewport; ScrollingViewport;
         import org.apache.royale.jewel.supportClasses.table.TBodyContentArea; TBodyContentArea;
         import org.apache.royale.jewel.supportClasses.combobox.ComboBoxList; ComboBoxList;
 
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as
new file mode 100644
index 0000000..21ab897
--- /dev/null
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/Viewport.as
@@ -0,0 +1,70 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.royale.jewel.supportClasses
+{
+	import org.apache.royale.core.IContentView;
+	import org.apache.royale.core.IStrand;
+	import org.apache.royale.core.UIBase;
+	import org.apache.royale.html.supportClasses.Viewport;
+	import org.apache.royale.utils.loadBeadFromValuesManager;
+
+    /**
+     * A Viewport is the area of a Container set aside for displaying
+     * content. If the content exceeds the visible area of the viewport
+	 * it will be clipped or hidden.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9.3
+     */
+	public class Viewport extends org.apache.royale.html.supportClasses.Viewport
+	{
+		/**
+		 * Constructor
+	     *
+	     *  @langversion 3.0
+	     *  @playerversion Flash 10.2
+	     *  @playerversion AIR 2.6
+	     *  @productversion Royale 0.9.3
+		 */
+		public function Viewport()
+		{
+            super();
+		}
+
+        /**
+		 * @royaleignorecoercion Class
+		 * @royaleignorecoercion org.apache.royale.core.UIBase
+		 */
+		COMPILE::JS
+		override public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			
+			contentArea = loadBeadFromValuesManager(IContentView, "iContentView", _strand) as UIBase;
+			
+			if (!contentArea)
+				contentArea = value as UIBase;
+			
+			// contentArea.element.style.overflow = "hidden";
+            contentArea.element.classList.add("viewport");
+		}
+    }
+}
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/scrollbar/ScrollingViewport.as
b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/scrollbar/ScrollingViewport.as
index 889d795..0a99025 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/scrollbar/ScrollingViewport.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/scrollbar/ScrollingViewport.as
@@ -18,7 +18,7 @@
 ////////////////////////////////////////////////////////////////////////////////
 package org.apache.royale.jewel.supportClasses.scrollbar
 {
-	import org.apache.royale.html.supportClasses.Viewport;
+	import org.apache.royale.jewel.supportClasses.Viewport;
 	import org.apache.royale.core.IBead;
     import org.apache.royale.core.IBorderPaddingMarginValuesImpl;
 	import org.apache.royale.core.IContainer;
@@ -97,7 +97,12 @@ package org.apache.royale.jewel.supportClasses.scrollbar
 			} else {
 				component = contentView as UIBase;
 			}
-			component.element.style.overflow = "auto";
+			//component.element.style.overflow = "auto";
+			
+			//remove hard coded style in Viewport (overflow: hidden)
+			//contentArea.element.removeAttribute("style");
+			// contentArea.element.classList.add("viewport");
+			contentArea.element.classList.add("scroll");
 		}
 		
 		/**
diff --git a/frameworks/projects/Jewel/src/main/sass/_global.sass b/frameworks/projects/Jewel/src/main/sass/_global.sass
index 782fb2c..ed4831d 100644
--- a/frameworks/projects/Jewel/src/main/sass/_global.sass
+++ b/frameworks/projects/Jewel/src/main/sass/_global.sass
@@ -85,7 +85,7 @@ j|VGroup
 j|Container
 	IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView")
 	//IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.BasicLayout")
-	IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
+	IViewport: ClassReference("org.apache.royale.jewel.supportClasses.Viewport")
 	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
 	//align-items: flex-start
 
@@ -104,7 +104,7 @@ j|DataContainer
 	IDataProviderItemRendererMapper: ClassReference("org.apache.royale.jewel.beads.itemRenderers.DataItemRendererFactoryForCollectionView")
 	IItemRendererClassFactory: ClassReference("org.apache.royale.core.ItemRendererClassFactory")
 	IItemRenderer: ClassReference("org.apache.royale.jewel.itemRenderers.StringItemRenderer")
-	IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
+	IViewport: ClassReference("org.apache.royale.jewel.supportClasses.Viewport")
 	IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
 
 @media -royale-swf
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_applicationmaincontent.sass
b/frameworks/projects/Jewel/src/main/sass/components/_applicationmaincontent.sass
index 7bab3f9..d6df042 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_applicationmaincontent.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_applicationmaincontent.sass
@@ -40,5 +40,5 @@
 j|ApplicationMainContent
     IBeadView: ClassReference("org.apache.royale.html.beads.ContainerView")
     //IBeadLayout: ClassReference("org.apache.royale.jewel.beads.layouts.VerticalLayout")
// Basic layoutr doesn't work here
-    IViewport: ClassReference("org.apache.royale.html.supportClasses.Viewport")
+    IViewport: ClassReference("org.apache.royale.jewel.supportClasses.Viewport")
     IViewportModel: ClassReference("org.apache.royale.html.beads.models.ViewportModel")
\ No newline at end of file
diff --git a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
index 24e029a..b155d79 100644
--- a/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
+++ b/frameworks/projects/Jewel/src/main/sass/components/_layout.sass
@@ -27,6 +27,12 @@ $gap: 0px
 $grid-columns: 12 !default
 $gap-size: 10px !default
 
+.viewport
+	overflow: hidden
+	
+	&.scroll
+		overflow: auto
+
 // Absolute
 .layout.absolute
 	position: absolute


Mime
View raw message