Skip to content

Commit

Permalink
Cleanup for 2.2 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Gross committed Dec 19, 2013
1 parent da0a32e commit 44fce6d
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 82 deletions.
35 changes: 18 additions & 17 deletions angular-busy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,34 @@ angular.module('cgBusy').directive('cgBusy',['promiseTracker','$compile','$templ

var options = scope.$eval(attrs.cgBusy);

if (typeof options === 'string' || angular.isArray(options)) {
if (angular.isString(options) || angular.isArray(options)) {
options = {tracker:options};
}
}

if (typeof options === 'undefined' || typeof options.tracker === 'undefined'){
if (angular.isUndefined(options) || angular.isUndefined(options.tracker)){
throw new Error('Options for cgBusy directive must be provided (tracker option is required).');
}

options.tracker = angular.isArray(options.tracker) ? options.tracker : [options.tracker];
options.tracker = angular.isArray(options.tracker) ? options.tracker : [options.tracker];

if (!scope.$cgBusyTracker){
if (!scope.$cgBusyTracker){
scope.$cgBusyTracker = {};
}

angular.forEach(options.tracker, function (tracker) {
scope.$cgBusyTracker[tracker] = promiseTracker(tracker);
});
angular.forEach(options.tracker, function (tracker) {
scope.$cgBusyTracker[tracker] = promiseTracker(tracker);
});

scope.isActive = function() {
var active = false;
angular.forEach(scope.$cgBusyTracker, function (tracker) {
if (tracker.active())
active = true;
});
scope.isActive = function() {
var active = false;
angular.forEach(scope.$cgBusyTracker, function (tracker) {
if (tracker.active()) {
active = true;
}
});

return active;
};
return active;
};

var position = element.css('position');
if (position === 'static' || position === '' || typeof position === 'undefined'){
Expand Down Expand Up @@ -67,5 +68,5 @@ angular.module('cgBusy').directive('cgBusy',['promiseTracker','$compile','$templ
}
};
}
]);
]);

2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-busy",
"version": "2.1.0",
"version": "2.2.0",
"main": [
"dist/angular-busy.js",
"dist/angular-busy.css"
Expand Down
102 changes: 40 additions & 62 deletions dist/angular-busy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,34 @@ angular.module('cgBusy').directive('cgBusy',['promiseTracker','$compile','$templ

var options = scope.$eval(attrs.cgBusy);

if (typeof options === 'string' || angular.isArray(options)) {
if (angular.isString(options) || angular.isArray(options)) {
options = {tracker:options};
}
}

if (typeof options === 'undefined' || typeof options.tracker === 'undefined'){
if (angular.isUndefined(options) || angular.isUndefined(options.tracker)){
throw new Error('Options for cgBusy directive must be provided (tracker option is required).');
}

options.tracker = angular.isArray(options.tracker) ? options.tracker : [options.tracker];
options.tracker = angular.isArray(options.tracker) ? options.tracker : [options.tracker];

if (!scope.$cgBusyTracker){
if (!scope.$cgBusyTracker){
scope.$cgBusyTracker = {};
}

angular.forEach(options.tracker, function (tracker) {
scope.$cgBusyTracker[tracker] = promiseTracker(tracker);
});
angular.forEach(options.tracker, function (tracker) {
scope.$cgBusyTracker[tracker] = promiseTracker(tracker);
});

scope.isActive = function() {
var active = false;
angular.forEach(scope.$cgBusyTracker, function (tracker) {
if (tracker.active())
active = true;
});
scope.isActive = function() {
var active = false;
angular.forEach(scope.$cgBusyTracker, function (tracker) {
if (tracker.active()) {
active = true;
}
});

return active;
};
return active;
};

var position = element.css('position');
if (position === 'static' || position === '' || typeof position === 'undefined'){
Expand Down Expand Up @@ -67,57 +68,34 @@ angular.module('cgBusy').directive('cgBusy',['promiseTracker','$compile','$templ
}
};
}
]);
]);


angular.module("cgBusy").run(["$templateCache", function($templateCache) {

$templateCache.put("angular-busy.html",
"<div class=\"cg-busy-default-wrapper\">\r" +
"\n" +
"\r" +
"\n" +
" <div class=\"cg-busy-default-sign\">\r" +
"\n" +
"\r" +
"\n" +
" <div class=\"cg-busy-default-spinner\">\r" +
"\n" +
" <div class=\"bar1\"></div>\r" +
"\n" +
" <div class=\"bar2\"></div>\r" +
"\n" +
" <div class=\"bar3\"></div>\r" +
"\n" +
" <div class=\"bar4\"></div>\r" +
"\n" +
" <div class=\"bar5\"></div>\r" +
"\n" +
" <div class=\"bar6\"></div>\r" +
"\n" +
" <div class=\"bar7\"></div>\r" +
"\n" +
" <div class=\"bar8\"></div>\r" +
"\n" +
" <div class=\"bar9\"></div>\r" +
"\n" +
" <div class=\"bar10\"></div>\r" +
"\n" +
" <div class=\"bar11\"></div>\r" +
"\n" +
" <div class=\"bar12\"></div>\r" +
"\n" +
" </div>\r" +
"\n" +
"\r" +
"\n" +
" <div class=\"cg-busy-default-text\">Please Wait...</div>\r" +
"\n" +
"\r" +
"\n" +
" </div>\r" +
"\n" +
"\r" +
"<div class=\"cg-busy-default-wrapper\">\n" +
"\n" +
" <div class=\"cg-busy-default-sign\">\n" +
"\n" +
" <div class=\"cg-busy-default-spinner\">\n" +
" <div class=\"bar1\"></div>\n" +
" <div class=\"bar2\"></div>\n" +
" <div class=\"bar3\"></div>\n" +
" <div class=\"bar4\"></div>\n" +
" <div class=\"bar5\"></div>\n" +
" <div class=\"bar6\"></div>\n" +
" <div class=\"bar7\"></div>\n" +
" <div class=\"bar8\"></div>\n" +
" <div class=\"bar9\"></div>\n" +
" <div class=\"bar10\"></div>\n" +
" <div class=\"bar11\"></div>\n" +
" <div class=\"bar12\"></div>\n" +
" </div>\n" +
"\n" +
" <div class=\"cg-busy-default-text\">Please Wait...</div>\n" +
"\n" +
" </div>\n" +
"\n" +
"</div>"
);
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-busy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-busy",
"version": "2.1.0",
"version": "2.2.0",
"description": "",
"repository": {
"type": "git",
Expand Down

0 comments on commit 44fce6d

Please sign in to comment.