Skip to content

Commit

Permalink
feat: ES6fy all the things!
Browse files Browse the repository at this point in the history
<3 e-sexy things
  • Loading branch information
ocombe committed Apr 9, 2015
1 parent 08ed860 commit 9cae48c
Show file tree
Hide file tree
Showing 24 changed files with 190 additions and 198 deletions.
4 changes: 2 additions & 2 deletions dist/modules/ocLazyLoad.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@
} else {
// config block
var callInvoke = function callInvoke(fct) {
var invoked = regConfigs.indexOf(moduleName + "-" + fct);
var invoked = regConfigs.indexOf("" + moduleName + "-" + fct);
if (invoked === -1 || reconfig) {
if (invoked === -1) {
regConfigs.push(moduleName + "-" + fct);
regConfigs.push("" + moduleName + "-" + fct);
}
if (angular.isDefined(provider)) {
provider[args[1]].apply(provider, args[2]);
Expand Down
2 changes: 1 addition & 1 deletion dist/modules/ocLazyLoad.directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
return model($scope) || $attr.ocLazyLoad; // it can be a module name (string), an object, an array, or a scope reference to any of this
}, function (moduleName) {
if (angular.isDefined(moduleName)) {
$ocLazyLoad.load(moduleName).then(function success() {
$ocLazyLoad.load(moduleName).then(function () {
$animate.enter($compile(content)($scope), $element);
});
}
Expand Down
6 changes: 3 additions & 3 deletions dist/modules/ocLazyLoad.loaders.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
var dc = new Date().getTime();
if (url.indexOf("?") >= 0) {
if (url.substring(0, url.length - 1) === "&") {
return url + "_dc=" + dc;
return "" + url + "_dc=" + dc;
}
return url + "&_dc=" + dc;
return "" + url + "&_dc=" + dc;
} else {
return url + "?_dc=" + dc;
return "" + url + "?_dc=" + dc;
}
};

Expand Down
10 changes: 5 additions & 5 deletions dist/modules/ocLazyLoad.loaders.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
}

if (params.serie && params.files.length > 0) {
return $q.all(promises).then(function success() {
return $q.all(promises).then(function () {
return $delegate.filesLoader(config, params);
});
} else {
Expand Down Expand Up @@ -150,9 +150,9 @@
});

// Resolve the promise once everything has loaded
$q.all(deferredList).then(function success(res) {
$q.all(deferredList).then(function (res) {
deferred.resolve(res);
}, function error(err) {
}, function (err) {
deferred.reject(err);
});

Expand Down Expand Up @@ -206,13 +206,13 @@
return $delegate.inject(config.name, localParams);
}

$delegate.filesLoader(config, localParams).then(function success() {
$delegate.filesLoader(config, localParams).then(function () {
$delegate.inject(null, localParams).then(function (res) {
deferred.resolve(res);
}, function (err) {
deferred.reject(err);
});
}, function error(err) {
}, function (err) {
deferred.reject(err);
});

Expand Down
4 changes: 2 additions & 2 deletions dist/modules/ocLazyLoad.loaders.cssLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
*/
$delegate.cssLoader = function (paths, callback, params) {
var promises = [];
angular.forEach(paths, function loading(path) {
angular.forEach(paths, function (path) {
promises.push($delegate.buildElement("css", path, params));
});
$q.all(promises).then(function success() {
$q.all(promises).then(function () {
callback();
}, function (err) {
callback(err);
Expand Down
6 changes: 3 additions & 3 deletions dist/modules/ocLazyLoad.loaders.jsLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
*/
$delegate.jsLoader = function (paths, callback, params) {
var promises = [];
angular.forEach(paths, function loading(path) {
angular.forEach(paths, function (path) {
promises.push($delegate.buildElement("js", path, params));
});
$q.all(promises).then(function success() {
$q.all(promises).then(function () {
callback();
}, function error(err) {
}, function (err) {
callback(err);
});
};
Expand Down
4 changes: 2 additions & 2 deletions dist/modules/ocLazyLoad.loaders.templatesLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
deferred.reject(new Error("Unable to load template file \"" + url + "\": " + err));
});
});
return $q.all(promises).then(function success() {
return $q.all(promises).then(function () {
callback();
}, function error(err) {
}, function (err) {
callback(err);
});
};
Expand Down
36 changes: 18 additions & 18 deletions dist/ocLazyLoad.js

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

2 changes: 1 addition & 1 deletion dist/ocLazyLoad.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 9cae48c

Please # to comment.