Skip to content

Commit aafb7cd

Browse files
authored
Merge pull request #2 from heavybeard/patch-1
Fixed undefined functions isObject and merge
2 parents dbd9e7e + 962540f commit aafb7cd

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

angular-sticky-kit.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ angular.module("angular-sticky-kit", [])
44
return {
55
restrict: "A",
66
link: function(scope, element, attributes) {
7-
var customOptions, defaultOpts, options, stickyElement, stickyKitAttribute;
8-
options = {};
7+
var customOptions, options, stickyElement, stickyKitAttribute;
98
stickyKitAttribute = scope.$eval(attributes.stickyKit);
10-
customOptions = Object.isObject(stickyKitAttribute) ? stickyKitAttribute : {};
11-
defaultOpts = {
9+
customOptions = typeof stickyKitAttribute == 'object' ? stickyKitAttribute : {};
10+
options = {
1211
sticky_class: "is_stuck",
1312
inner_scrolling: true,
1413
recalc_every: null,
@@ -23,7 +22,9 @@ angular.module("angular-sticky-kit", [])
2322
recalc: null,
2423
detach: null
2524
};
26-
options = Object.merge(defaultOpts, customOptions);
25+
for (var attrname in customOptions) {
26+
options[attrname] = customOptions[attrname];
27+
}
2728
stickyElement = element.stick_in_parent(options);
2829
if (typeof stick !== "undefined" && stick !== null) {
2930
element.on("sticky_kit:stick", stick);

0 commit comments

Comments
 (0)