You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@royale.apache.org by GitBox <gi...@apache.org> on 2017/12/13 00:17:15 UTC

[GitHub] justinmclean closed pull request #78: Stop text overflow in Button fixes #77

justinmclean closed pull request #78: Stop text overflow in Button fixes #77
URL: https://github.com/apache/royale-asjs/pull/78
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/frameworks/projects/Basic/src/main/resources/basic-manifest.xml b/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
index 90b72b35b..5d33ad6ce 100644
--- a/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Basic/src/main/resources/basic-manifest.xml
@@ -117,6 +117,7 @@
     <component id="PasswordInputBead" class="org.apache.royale.html.accessories.PasswordInputBead" />
     <component id="PasswordInputRemovableBead" class="org.apache.royale.html.accessories.PasswordInputRemovableBead" />
     <component id="TextPromptBead" class="org.apache.royale.html.accessories.TextPromptBead" />
+    <component id="TextOverflow" class="org.apache.royale.html.beads.TextOverflow" />
     <component id="HRule" class="org.apache.royale.html.HRule" />
     <component id="VRule" class="org.apache.royale.html.VRule" />
     <component id="Spacer" class="org.apache.royale.html.Spacer" />
diff --git a/frameworks/projects/Basic/src/main/royale/BasicClasses.as b/frameworks/projects/Basic/src/main/royale/BasicClasses.as
index b67b03aea..d84cdb6b0 100644
--- a/frameworks/projects/Basic/src/main/royale/BasicClasses.as
+++ b/frameworks/projects/Basic/src/main/royale/BasicClasses.as
@@ -99,6 +99,7 @@ internal class BasicClasses
     	import org.apache.royale.html.beads.TextInputView; TextInputView;
 	    import org.apache.royale.html.beads.TextInputWithBorderView; TextInputWithBorderView;
 	}
+	import org.apache.royale.html.beads.TextOverflow; TextOverflow;
 	import org.apache.royale.html.beads.models.AlertModel; AlertModel;
 	import org.apache.royale.html.beads.models.ArraySelectionModel; ArraySelectionModel;
 	import org.apache.royale.html.beads.models.ArrayListSelectionModel; ArrayListSelectionModel;
diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextOverflow.as b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextOverflow.as
new file mode 100644
index 000000000..679e8f551
--- /dev/null
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/TextOverflow.as
@@ -0,0 +1,87 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.html.beads
+{
+
+	import org.apache.royale.core.IBead;
+	import org.apache.royale.core.IStrand;
+    import org.apache.royale.core.IUIBase;
+
+	/**
+	 *  The TextOverflow class is a bead that can be used with
+	 *  a TextButton control to stop the text from overflowing.
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10.2
+	 *  @playerversion AIR 2.6
+	 *  @productversion Royale 0.9
+	 */
+	public class TextOverflow implements IBead
+	{
+		/**
+		 *  constructor.
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 */
+		public function TextOverflow()
+		{
+		}
+
+		private var _strand:IStrand;
+
+		/**
+		 *  @copy org.apache.royale.core.IBead#strand
+		 *
+		 *  @langversion 3.0
+		 *  @playerversion Flash 10.2
+		 *  @playerversion AIR 2.6
+		 *  @productversion Royale 0.9
+		 */
+		public function set strand(value:IStrand):void
+		{
+			_strand = value;
+			updateHost(null);
+		}
+
+        /**
+         * @royaleignorecoercion org.apache.royale.core.IUIBase
+         */
+		private function get host():IUIBase
+		{
+			return _strand as IUIBase;
+		}
+        
+		private function updateHost(value:Object):void
+		{
+			COMPILE::SWF
+			{
+				// Nothing to do as by default ellipsis are added
+			}
+			COMPILE::JS
+			{
+				host.element.style.overflow = "hidden";
+				host.element.style.textOverflow = "ellipsis";
+			}
+		}
+
+	}
+}


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services