Permalink
Browse files

minor bugs fixed

  • Loading branch information...
lavmax committed May 11, 2011
1 parent 538292e commit dc584d13cd97fc33982a38c5457dcf8d9b9d40e9
Showing with 16 additions and 9 deletions.
  1. +1 −1 Docs/MUX.Loaders.md
  2. +13 −6 Source/MUX.Loaders.js
  3. +2 −2 Source/MUX.Loaders.min.js
View
@@ -1,5 +1,5 @@
<h2>MUX Loaders</h2>
-<p>is a library with AJAX loaders animated icons made with html+css and without any graphic files. It was tested on IE 7+, Firefos 3+, Opera 11, Safari, Chrome, Mobile Safari 4+ and Android 2.3. In some old browsers gradients and borders radius don't work - it's normal. In IE 9 borders radius doesn't work too because of a bug (or feature) in IE.</p>
+<p>is a library with AJAX loaders animated icons made with html+css and without any graphic files. It was tested on IE 7+, Firefos 3+, Opera 11, Safari, Chrome, Mobile Safari 4+ and Android 2.3. In some old browsers gradients and borders radius don't work - it's normal. In IE 9 borders radius doesn't work with gradient background too because of a bug (or feature) in IE - use solid color or loaders will be square.</p>
<p>You can see demo here <a href="http://lavmax.github.com/MUX.Loaders">http://lavmax.github.com/MUX.Loaders</a></p>
<p>All loaders depend only from <code>MUX.Loader</code> class and are independent from each other, so you can easily remove loaders you don't use from <code>MUX.Loaders.js</code>.</p>
<h3>MUX.Loader</h3>
View
@@ -9,7 +9,7 @@ copyright: Copyright (c) 2011 by Max Lavrov (lavmax).
authors: Max Lavrov (lavmax)
requires:
- core/1.3.2: '*'
+ core/1.3: '*'
provides: [MUX.Loader, MUX.Loader.Bar, MUX.Loader.Radar, MUX.Loader.Well, MUX.Loader.Cicles, MUX.Loader.Fb]
@@ -68,6 +68,11 @@ MUX.Loader = new Class({
elem.style.cssText += backgroundText;
},
+ _noRadius: function()
+ {
+ return !!((Browser.ie && typeOf(this.options.background) === 'array') || (Browser.Platform.ios && Browser.safari && Browser.version < 5));
+ },
+
__animate: function()
{
// Check if it's time to stop the animation
@@ -207,13 +212,15 @@ MUX.Loader.Radar = new Class({
{
this.setOptions(options);
+ var noRadius = this._noRadius();
+
this.elem = new Element('div', {
styles: {
'height': this.options.size,
'width': this.options.size,
'overflow': 'hidden',
- 'border-radius': Browser.ie ? 0 : (this.options.size.toInt() / 2) + 'px',
- '-webkit-border-radius': (this.options.size.toInt() / 2) + 'px',
+ 'border-radius': noRadius ? 0 : (this.options.size.toInt() / 2) + 'px',
+ '-webkit-border-radius': noRadius ? 0 : (this.options.size.toInt() / 2) + 'px',
'-moz-border-radius': (this.options.size.toInt() / 2) + 'px'
}
@@ -270,7 +277,7 @@ MUX.Loader.Well = new Class({
this.options.size = (typeof this.options.size === 'string') ? this.options.size.toInt() : this.options.size;
- var noRadius = (Browser.ie || (Browser.Platform.ios && Browser.safari && Browser.version < 5));
+ var noRadius = this._noRadius();
this.elem = new Element('div', {
styles: {
@@ -311,7 +318,7 @@ MUX.Loader.Well = new Class({
'background': this.options.color,
'border-radius': noRadius ? 0 : (this.options.size / 2) + 'px',
'-webkit-border-radius': noRadius ? 0 : (this.options.size / 2) + 'px',
- '-moz-border-radius': (this.shift / 2) + 'px'
+ '-moz-border-radius': (this.options.size / 2) + 'px'
}
}).inject(this.elem));
this.runners.push(this.runners[0].clone().inject(this.elem));
@@ -385,7 +392,7 @@ MUX.Loader.Circles = new Class({
this.options.size = (typeof this.options.size === 'string') ? this.options.size.toInt() : this.options.size;
- var noRadius = (Browser.ie || (Browser.Platform.ios && Browser.safari && Browser.version < 5));
+ var noRadius = this._noRadius();
this.elem = new Element('div', {
styles: {
Oops, something went wrong.

0 comments on commit dc584d1

Please sign in to comment.