Skip to content

Commit

Permalink
Renamed TextOverflow to be more descriptive
Browse files Browse the repository at this point in the history
Added support so it can be used with Label
  • Loading branch information
Harbs committed Mar 16, 2018
1 parent 235f746 commit 2e412a9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,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="EllipsisOverflow" class="org.apache.royale.html.beads.EllipsisOverflow" />
<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" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ package org.apache.royale.html.beads
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.
* The EllipsisOverflow class is a bead that can be used
* to stop the text from overflowing and display an ellipsis.
*
* @langversion 3.0
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
public class TextOverflow implements IBead
public class EllipsisOverflow implements IBead
{
/**
* constructor.
Expand All @@ -42,7 +42,7 @@ package org.apache.royale.html.beads
* @playerversion AIR 2.6
* @productversion Royale 0.9
*/
public function TextOverflow()
public function EllipsisOverflow()
{
}

Expand All @@ -55,31 +55,21 @@ package org.apache.royale.html.beads
* @playerversion Flash 10.2
* @playerversion AIR 2.6
* @productversion Royale 0.9
* @royaleignorecoercion org.apache.royale.core.IUIBase
*/
public function set strand(value:IStrand):void
{
_strand = value;
updateHost();
}

/**
* @royaleignorecoercion org.apache.royale.core.IUIBase
*/
private function get host():IUIBase
{
return _strand as IUIBase;
}

private function updateHost():void
{
COMPILE::SWF
{
// Nothing to do as by default ellipsis are added
}
COMPILE::JS
{
host.element.style.overflow = "hidden";
host.element.style.textOverflow = "ellipsis";
var style:CSSStyleDeclaration = (_strand as IUIBase).element.style;
style.overflow = "hidden";
style.textOverflow = "ellipsis";
style.display = "block";
}
}

Expand Down

0 comments on commit 2e412a9

Please sign in to comment.