From c8a83c8fc3e3a1fc9ccf0421b3d3d823e2605820 Mon Sep 17 00:00:00 2001 From: Tim Wienk Date: Sun, 26 Sep 2010 22:16:12 +0200 Subject: [PATCH] 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. --- Docs/Interface/Spinner.md | 2 +- Source/Interface/Spinner.js | 11 ++++++----- Styles/Interface/Spinner/spinner.css | 1 + Tests/_assets/spinner.css | 1 + 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Docs/Interface/Spinner.md b/Docs/Interface/Spinner.md index f41ecc61..f9d785df 100644 --- a/Docs/Interface/Spinner.md +++ b/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 diff --git a/Source/Interface/Spinner.js b/Source/Interface/Spinner.js index aeb3116d..bb9cbc1d 100644 --- a/Source/Interface/Spinner.js +++ b/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'); diff --git a/Styles/Interface/Spinner/spinner.css b/Styles/Interface/Spinner/spinner.css index 6a373828..964155b0 100644 --- a/Styles/Interface/Spinner/spinner.css +++ b/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; } diff --git a/Tests/_assets/spinner.css b/Tests/_assets/spinner.css index 6a373828..964155b0 100644 --- a/Tests/_assets/spinner.css +++ b/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; }