Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed several bugs

* Actor and Target links are now clickable (this is due to a known bug with
  hrefs in Labels in Flex)
* Fixed "If I click Hide Comments and then quickly click "show comments" before
  it's done hiding, then it'll hide and say "Hide Commens" as if it's open even
  tho it's now closed." bug. Now, when the user clicks on the button during
  animation, the button press will be ignored.
* Fixed weird bug in Toasts where if the CPU was busy while the notification
  appeared, it would disappear too soon.
* Set toast idle threshold to 120 seconds
* Fixed "If I click Comment with an empty field it submits "Write a comment...""
  • Loading branch information...
commit 5a3e1290b39c787d149b2938d26c4340ad8f018a 1 parent 283a01a
keito authored
View
13 fbair/nile/renderers/NileRenderer.mxml
@@ -48,9 +48,12 @@
<util:FlowBox width="100%"
styleName="nileStoryHeader" >
<!-- Actor's name -->
- <mx:Label styleName="actorTitle"
+ <mx:Label id="actorName"
+ styleName="actorTitle"
htmlText="{StringUtil.linkify(data.actorName,
- data.actorURL)}" />
+ data.actorURL)}"
+ click="{navigateToURL(new URLRequest(data.actorURL))}"
+ buttonMode="true" />
<!-- Target of wall-post -->
<mx:HBox styleName="nileStoryTarget"
visible="{data.targetName}"
@@ -59,8 +62,10 @@
<mx:Label styleName="targetArrow" text="" />
<mx:Label styleName="actorTitle"
- htmlText="{StringUtil.linkify(data.targetName,
- data.targetURL)}" />
+ htmlText="{StringUtil.linkify(data.targetName,
+ data.targetURL)}"
+ click="{navigateToURL(new URLRequest(data.targetURL))}"
+ buttonMode="true" />
</mx:HBox>
<!-- Tells us the time ago since it happened -->
View
2  fbair/nile/renderers/UFI.mxml
@@ -196,7 +196,7 @@
[Bindable]
public function get ufiMode():int { return _ufiMode; }
public function set ufiMode(to:int):void {
- if (_ufiMode == to) return;
+ if (_ufiMode == to || ufiDetail.isAnimating) return;
_ufiMode = to;
switch (ufiMode) {
View
8 fbair/notification/Toast.mxml
@@ -69,7 +69,8 @@
alphaFrom="0"
alphaTo="{MAX_FADEIN_ALPHA}"
duration="500"
- effectStart="fadeInEffectStart(event)" />
+ effectStart="landingEffect.play()"
+ effectEnd="fadeInEffectEnd(event)" />
<mx:Fade id="fadeout"
target="{shelf}"
alphaFrom="{MAX_FADEIN_ALPHA}"
@@ -199,12 +200,11 @@
}
/**
- * Called at the same time that the fade in effect starts.
+ * Called at the same time that the fade in effect ends.
*/
- private function fadeInEffectStart(event:EffectEvent): void {
+ private function fadeInEffectEnd(event:EffectEvent): void {
reaper.delay = TOAST_HIDE_DELAY;
reaper.start();
- landingEffect.play();
}
/**
View
2  fbair/notification/ToastManager.as
@@ -27,7 +27,7 @@ package fbair.notification {
*/
public class ToastManager {
// Seconds to wait without mouse/keyboard activity to consider user idle
- private static const IDLE_THRESHOLD:int = 30;
+ private static const IDLE_THRESHOLD:int = 120;
// Maximum number of notifications to display singly
private static const MAX_DISPLAY_SINGLE_ALERT_TOAST:int = 3;
View
9 fbair/util/display/AnimatedCanvas.as
@@ -16,13 +16,12 @@
// Animating Canvas
package fbair.util.display {
import fb.util.Output;
-
+
import flash.display.DisplayObject;
import flash.events.Event;
-
+
import mx.containers.Canvas;
import mx.core.UIComponent;
- import mx.events.FlexEvent;
[Event(name="tweenComplete", type="flash.events.Event")]
[Event(name="tweenStarting", type="flash.events.Event")]
@@ -51,6 +50,9 @@ package fbair.util.display {
// animate speed. 0 is stopped and 1 is immediate
[Bindable] public var gain:Number = 0.30;
+ // are we currently playing effects?
+ [Bindable] public var isAnimating:Boolean = false;
+
// epsilon is a very small value, we use it in this case when we're
// 'close enough' to the target value to end the animation
private var epsilon:Number = 0.1;
@@ -62,7 +64,6 @@ package fbair.util.display {
// in case we accelerate past our target, we still know when to stop
private var isGrowing:Boolean;
- private var isAnimating:Boolean = false;
private var velocity:Number = 0;
private var _visible:Boolean = true;
private var managedHeight:Number = 0;
View
12 fbair/util/display/GrowableTextArea.as
@@ -15,8 +15,6 @@
*/
// Simple TextArea extension grows with text size
package fbair.util.display {
- import fb.util.Output;
-
import flash.events.Event;
import flash.events.FocusEvent;
import flash.events.KeyboardEvent;
@@ -71,12 +69,20 @@ package fbair.util.display {
stage.addEventListener(MouseEvent.MOUSE_UP, prepareUp, true);
}
-
private function focusOut(event:FocusEvent = null):void {
stage.removeEventListener(MouseEvent.MOUSE_DOWN, stageDown, true);
stage.removeEventListener(MouseEvent.MOUSE_UP, stageUp, true);
active = (text.length > 0);
}
+
+ // Override text property so that it only returns user-entered values
+ [Bindable] override public function get text():String {
+ if (getStyle("color") == disabledColor) return '';
+ return super.text;
+ }
+ public function set text(to:String):void {
+ super.text = to;
+ }
// Stage up and down
private function prepareUp(event:MouseEvent):void {
Please sign in to comment.
Something went wrong with that request. Please try again.