Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ or
</div>
```

Enhancements in 0.1.2
---------------------
Enhancements in 0.1.2+
----------------------

Is now a UMD module for AMD or browser globals. Spin.js is so it is easier to use this with AMD now.

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-spin",
"version": "0.1.2",
"version": "0.1.3",
"main": "src/angular-spin.js",
"ignore": [
"**/.*",
Expand Down
22 changes: 16 additions & 6 deletions src/angular-spin.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@
'use strict';
angular.module('spin.js', [])
.directive('spin', function () {
var augmentOpts = function (color, opts) {
if (!opts.color) {
opts.color = color;
}
};
var getColor = function (el) {
var color;
el = el[0];
if (window.getComputedStyle) {
color = window.getComputedStyle(el, null).getPropertyValue('color');
} else if (document.documentElement.currentStyle) {
color = el.currentStyle['color'];
}
return color;
},
augmentOpts = function (color, opts) {
if (!opts.color) {
opts.color = color;
}
};
return {
restrict: 'A',
transclude:true,
Expand All @@ -23,7 +33,7 @@
spinif: '=spinIf'
},
link: function (scope, element, attrs) {
var cssColor = element.css('color'),
var cssColor = element.css('color') || getColor(element),
stoped = false,
hideElement = !!scope.config.hideElement,
spinner;
Expand Down