Skip to content

Commit

Permalink
- Valid deep extend
Browse files Browse the repository at this point in the history
- Ace added to bower json

Closes #6565
  • Loading branch information
itburnz committed Jul 1, 2014
1 parent 0f3239c commit 83d2520
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 29 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = function (grunt) {
'<%= grunt.template.today("yyyy-mm-dd") %> */' +
'(function (root, factory) {' +
'if (typeof define === "function" && define.amd) {' +
'define(["angular-tether"], factory);' +
'define(["tether"], factory);' +
'} else if (typeof exports === "object") {' +
'module.exports = factory(require("tether"));' +
'} else {' +
Expand Down
5 changes: 3 additions & 2 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-tether",
"version": "0.1.1",
"version": "0.1.3",
"main": "./dist/angular-tether.js",
"repository": {
"type": "git",
Expand All @@ -9,7 +9,8 @@
"dependencies": {
"angular": "~1.2.18",
"tether": "~0.6.5",
"angular-animate": "~1.2.18"
"angular-animate": "~1.2.18",
"angular-ui-ace": "~0.1.1"
},
"ignore": [
"node_modules",
Expand Down
21 changes: 9 additions & 12 deletions dist/angular-tether.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! angular-tether - v0.1.1 - 2014-06-23 */(function (root, factory) {if (typeof define === "function" && define.amd) {define(["angular-tether"], factory);} else if (typeof exports === "object") {module.exports = factory(require("tether"));} else {root.test = factory(root.Tether)};}(this, function(Tether) {angular.module('ngTetherPopover', ['ngTether']).directive('tetherPopover', [
/*! angular-tether - v0.1.3 - 2014-07-01 */(function (root, factory) {if (typeof define === "function" && define.amd) {define(["tether"], factory);} else if (typeof exports === "object") {module.exports = factory(require("tether"));} else {root.test = factory(root.Tether)};}(this, function(Tether) {angular.module('ngTetherPopover', ['ngTether']).directive('tetherPopover', [
'Tether',
'$parse',
'Utils',
Expand Down Expand Up @@ -79,16 +79,13 @@ angular.module('ngTether', []).factory('Utils', [
'$compile',
function ($compile) {
var Utils = {};
Utils.extendDeep = function (destination, source) {

This comment has been minimized.

Copy link
@nissoh

nissoh Jul 1, 2014

Owner

Closes #1

for (var property in source) {
if (source[property] && source[property].constructor && source[property].constructor === Object) {
destination[property] = destination[property] || {};
arguments.callee(destination[property], source[property]);
} else {
destination[property] = source[property];
}
}
return destination;
Utils.extendDeep = function deepExtend(target, source) {
for (var prop in source)
if (prop in target)
angular.extend(target[prop], source[prop]);
else
target[prop] = source[prop];
return target;
};
return Utils;
}
Expand Down Expand Up @@ -170,7 +167,7 @@ angular.module('ngTether', []).factory('Utils', [
if (element) {
$timeout(function () {
tether.destroy();
$animate.leave(element);
element && $animate.leave(element);
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-tether.min.js

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

21 changes: 8 additions & 13 deletions src/angular-tether.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@
angular.module('ngTether', [])
.factory('Utils', function($compile) {
var Utils = {};

Utils.extendDeep = function(destination, source) {
for (var property in source) {
if (source[property] && source[property].constructor &&
source[property].constructor === Object) {
destination[property] = destination[property] || {};
arguments.callee(destination[property], source[property]);
} else {
destination[property] = source[property];
}
}
return destination;
Utils.extendDeep = function deepExtend(target, source) {
for (var prop in source)
if (prop in target)
angular.extend(target[prop], source[prop]);
else
target[prop] = source[prop];
return target;
};

return Utils;
Expand Down Expand Up @@ -113,7 +108,7 @@ angular.module('ngTether', [])
if (element) {
$timeout(function(){
tether.destroy();
$animate.leave(element);
element && $animate.leave(element);
});
}
}
Expand Down

0 comments on commit 83d2520

Please sign in to comment.