You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2018/08/31 20:01:44 UTC

[royale-asjs] branch develop updated: remove callLater since seems not be needed in any browser tested

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 4c11749  remove callLater since seems not be needed in any browser tested
4c11749 is described below

commit 4c11749ee5913c370295f6923ca83696bade9cf7
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Aug 31 22:01:40 2018 +0200

    remove callLater since seems not be needed in any browser tested
---
 .../jewel/beads/controllers/ComboBoxController.as  | 11 ++++--
 .../royale/jewel/supportClasses/util/callLater.as  | 42 ----------------------
 2 files changed, 8 insertions(+), 45 deletions(-)

diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
index 403ab2b..7ed2e16 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controllers/ComboBoxController.as
@@ -27,8 +27,11 @@ package org.apache.royale.jewel.beads.controllers
 	import org.apache.royale.jewel.TextInput;
 	import org.apache.royale.jewel.List;
 	import org.apache.royale.jewel.beads.controls.combobox.IComboBoxView;
-	import org.apache.royale.jewel.supportClasses.util.callLater;
 	import org.apache.royale.utils.loadBeadFromValuesManager;
+	COMPILE::SWF
+	{
+		import flash.utils.setTimeout;
+    }
 	
 	/**
 	 *  The ComboBoxController class is responsible for listening to
@@ -92,10 +95,12 @@ package org.apache.royale.jewel.beads.controllers
 		{
 			IEventDispatcher(viewBead.popup).addEventListener(MouseEvent.MOUSE_DOWN, handleControlMouseDown);
 			IEventDispatcher(_strand).addEventListener(MouseEvent.MOUSE_DOWN, handleControlMouseDown);
-			callLater(callLaterCallBack);
+			
+			// rq = requestAnimationFrame(prepareForPopUp); // not work in Chrome/Firefox, while works in Safari, IE11, setInterval/Timer as well doesn't work right in Firefox
+			setTimeout(prepareForPopUp,  300);
 		}
 
-		private function callLaterCallBack():void {
+		private function prepareForPopUp():void {
 			IUIBase(viewBead.popup).topMostEventDispatcher.addEventListener(MouseEvent.MOUSE_DOWN, handleTopMostEventDispatcherMouseDown);
 		}
 		
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/util/callLater.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/util/callLater.as
deleted file mode 100644
index 0afb1a8..0000000
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/supportClasses/util/callLater.as
+++ /dev/null
@@ -1,42 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-//  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.util
-{
-    COMPILE::SWF
-    {
-        import flash.utils.setTimeout;
-    }
-    
-    public function callLater(fn:Function, args:Array = null, thisArg:Object = null):void
-    {
-        var calls:Array = [ {thisArg: thisArg, fn: fn, args: args } ];
-        setTimeout(makeCalls, 0);
-        function makeCalls():void
-        {
-            var list:Array = calls;
-            var n:int = list.length;
-            for (var i:int = 0; i < n; i++)
-            {
-                var call:Object = list.shift();
-                var fn:Function = call.fn;
-                fn.apply(call.thisArg, call.args);
-            }
-        }
-    }
-}