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/01/04 15:55:04 UTC

[royale-asjs] branch develop updated: loadCSS: add and return the id for later management

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 ef11913  loadCSS: add and return the id for later management
ef11913 is described below

commit ef11913da4c1a150bec98a8eed0ef8aff32a1957
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Sat Jan 4 16:54:52 2020 +0100

    loadCSS: add and return the id for later management
---
 .../Core/src/main/royale/org/apache/royale/utils/css/loadCSS.as       | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/css/loadCSS.as b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/css/loadCSS.as
index 951e347..7ad276d 100644
--- a/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/css/loadCSS.as
+++ b/frameworks/projects/Core/src/main/royale/org/apache/royale/utils/css/loadCSS.as
@@ -29,16 +29,18 @@ package org.apache.royale.utils.css
 	 * @royaleignorecoercion HTMLLinkElement
 	 */
 	COMPILE::JS
-	public function loadCSS(url:String, callback:Function = null):void
+	public function loadCSS(url:String, callback:Function = null):String
 	{
 		var link:HTMLLinkElement = document.createElement('link') as HTMLLinkElement;
 		link.setAttribute('rel', 'stylesheet');
 		link.setAttribute('type', 'text/css');
 		link.setAttribute('href', url);
+		link.id = 'link' + new Date().getTime();
 		if (callback)
 		{
 			link.onload = callback;
 		}
 		document.head.appendChild(link);
+		return link.id;
 	}
 }
\ No newline at end of file