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 2020/06/14 11:53:31 UTC

[royale-asjs] branch develop updated: new Core isFocused function

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 3c64a7a  new Core isFocused function
3c64a7a is described below

commit 3c64a7acd8e45bb76791114465700b978f8fc139
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sun Jun 14 13:53:22 2020 +0200

    new Core isFocused function
---
 .../projects/Core/src/main/royale/CoreClasses.as   |  1 +
 .../org/apache/royale/utils/html/isFocused.as      | 31 ++++++++++++++++++++++
 2 files changed, 32 insertions(+)

diff --git a/frameworks/projects/Core/src/main/royale/CoreClasses.as b/frameworks/projects/Core/src/main/royale/CoreClasses.as
index cba38dc..b16ddc0 100644
--- a/frameworks/projects/Core/src/main/royale/CoreClasses.as
+++ b/frameworks/projects/Core/src/main/royale/CoreClasses.as
@@ -351,6 +351,7 @@ internal class CoreClasses
 	{
 	import org.apache.royale.utils.css.transitionEventAvailable; transitionEventAvailable;
 	import org.apache.royale.utils.html.getStyle; getStyle;
+	import org.apache.royale.utils.html.isFocused; isFocused;
 	}
 	
 	import org.apache.royale.utils.replaceBead; replaceBead;
diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/html/isFocused.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/html/isFocused.as
new file mode 100644
index 0000000..3e4b004
--- /dev/null
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/html/isFocused.as
@@ -0,0 +1,31 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  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.utils.html
+{
+	import org.apache.royale.core.ElementWrapper;
+
+	/**
+	 * @royalesuppressexport
+	 */
+	COMPILE::JS
+	public function isFocused(host:ElementWrapper):Boolean
+	{
+		return host.element == document.activeElement;
+	}
+}