Skip to content

Commit

Permalink
Fixes #342. Spinner opacity hard-coded.
Browse files Browse the repository at this point in the history
- 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
timwienk committed Sep 26, 2010
1 parent 893809c commit c8a83c8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Docs/Interface/Spinner.md
Expand Up @@ -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

Expand Down
11 changes: 6 additions & 5 deletions Source/Interface/Spinner.js
Expand Up @@ -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'
Expand Down Expand Up @@ -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');
Expand Down
1 change: 1 addition & 0 deletions Styles/Interface/Spinner/spinner.css
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions Tests/_assets/spinner.css
Expand Up @@ -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;
}
Expand Down

0 comments on commit c8a83c8

Please sign in to comment.