Browse Source

Add isOpera, isIE is false if opera

Francois Nicaise 19 years ago
parent
commit
ddc8fd0cc9
2 changed files with 3 additions and 1 deletions
  1. 2 1
      std/js/Boot.hx
  2. 1 0
      std/js/Lib.hx

+ 2 - 1
std/js/Boot.hx

@@ -180,7 +180,8 @@ class Boot {
 
 
 	private static function __init() {
 	private static function __init() {
 		untyped {
 		untyped {
-			Lib.isIE = (document.all != null);
+			Lib.isIE = (document.all != null && window.opera == null );
+			Lib.isOpera = (window.opera != null );
 			Array.prototype.copy = Array.prototype.slice;
 			Array.prototype.copy = Array.prototype.slice;
 			Array.prototype.insert = function(i,x) {
 			Array.prototype.insert = function(i,x) {
 				this.splice(i,0,x);
 				this.splice(i,0,x);

+ 1 - 0
std/js/Lib.hx

@@ -29,6 +29,7 @@ import js.Dom;
 class Lib {
 class Lib {
 
 
 	public static var isIE : Bool;
 	public static var isIE : Bool;
+	public static var isOpera : Bool;
 	public static var document : Document = untyped __js__("document");
 	public static var document : Document = untyped __js__("document");
 	public static var window : Window = untyped __js__("window");
 	public static var window : Window = untyped __js__("window");