Browse files

Fixes #342. Spinner opacity hard-coded.

- Styles now do have effect on opacity.
- Small behavioural change, without any style a spinner now has an
  opacity of 1, previously 0.9. This shouldn't be a problem, though.
  Without any styles, the spinner wouldn't show up anyway.
  • Loading branch information...
1 parent 893809c commit c8a83c8fc3e3a1fc9ccf0421b3d3d823e2605820 @timwienk timwienk committed Sep 26, 2010
Showing with 9 additions and 6 deletions.
  1. +1 −1 Docs/Interface/Spinner.md
  2. +6 −5 Source/Interface/Spinner.js
  3. +1 −0 Styles/Interface/Spinner/spinner.css
  4. +1 −0 Tests/_assets/spinner.css
View
2 Docs/Interface/Spinner.md
@@ -31,7 +31,7 @@ Adds a semi-transparent overlay over a DOM element with a 'spinning' ajax icon.
### Styles
-You can style the layer and its contents by just defining a css style for the class names specified in the options class name (these default to ".spinner", ".spinner-content", and ".spinner-img"). You can download the default styles and spinner image here: [spinner.css](http://github.com/mootools/mootools-more/raw/master/Styles/Interface/Spinner/spinner.css), [spinner.gif](http://github.com/mootools/mootools-more/raw/master/Styles/Interface/Spinner/spinner.gif)
+You can style the layer and its contents by just defining a css style for the class names specified in the options class name (these default to ".spinner", ".spinner-content", and ".spinner-img"). You can download the default styles and spinner image here: [spinner.css](http://github.com/mootools/mootools-more/raw/master/Styles/Interface/Spinner/spinner.css), [spinner.gif](http://github.com/mootools/mootools-more/raw/master/Styles/Interface/Spinner/spinner.gif). Without any styles nothing will show up, except for any optional message you may have passed.
### Events
View
11 Source/Interface/Spinner.js
@@ -31,16 +31,16 @@ var Spinner = new Class({
options: {/*
message: false,*/
- 'class':'spinner',
+ 'class': 'spinner',
containerPosition: {},
content: {
- 'class':'spinner-content'
+ 'class': 'spinner-content'
},
messageContainer: {
- 'class':'spinner-msg'
+ 'class': 'spinner-msg'
},
img: {
- 'class':'spinner-img'
+ 'class': 'spinner-img'
},
fxOptions: {
link: 'chain'
@@ -106,10 +106,11 @@ var Spinner = new Class({
this.parent();
pos();
} else {
+ if (!this.options.style.opacity) this.options.style.opacity = this.element.getStyle('opacity').toFloat();
this.element.setStyles({
display: 'block',
opacity: 0
- }).tween('opacity', this.options.style.opacity || 0.9);
+ }).tween('opacity', this.options.style.opacity);
pos();
this.hidden = false;
this.fireEvent('show');
View
1 Styles/Interface/Spinner/spinner.css
@@ -2,6 +2,7 @@
position: absolute;
opacity: 0.9;
filter: alpha(opacity=90);
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=90);
z-index: 999;
background: #fff;
}
View
1 Tests/_assets/spinner.css
@@ -2,6 +2,7 @@
position: absolute;
opacity: 0.9;
filter: alpha(opacity=90);
+ -ms-filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=90);
z-index: 999;
background: #fff;
}

0 comments on commit c8a83c8

Please sign in to comment.