Skip to content

Commit

Permalink
Fix UMD
Browse files Browse the repository at this point in the history
  • Loading branch information
markgoodyear committed May 27, 2015
1 parent 1048173 commit a71e317
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Headhesive changelog

## v1.2.2
- [Fix] Fix UMD support

## v1.2.1
- [Fix] Bump version to publish to npm

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": "Headhesive.js",
"version": "1.2.1",
"version": "1.2.2",
"homepage": "http://markgoodyear.com/labs/headhesive/",
"authors": [
"Mark Goodyear <hello@markgoodyear.com> (http://markgoodyear.com)"
Expand Down
12 changes: 7 additions & 5 deletions dist/headhesive.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
/*!
* Headhesive.js v1.2.0 - An on-demand sticky header
* Headhesive.js v1.2.1 - An on-demand sticky header
* Author: Copyright (c) Mark Goodyear <@markgdyr> <http://markgoodyear.com>
* Url: http://markgoodyear.com/labs/headhesive
* License: MIT
*/
(function(root, factory) {
if (typeof define === "function" && define.amd) {
define([], factory(root));
define([], function() {
return factory();
});
} else if (typeof exports === "object") {
module.exports = factory(root);
module.exports = factory();
} else {
root.Headhesive = factory(root);
root.Headhesive = factory();
}
})(this, function(root) {
})(this, function() {
"use strict";
var _mergeObj = function(to, from) {
for (var p in from) {
Expand Down
4 changes: 2 additions & 2 deletions dist/headhesive.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,7 +1,7 @@
{
"name": "headhesive",
"description": "An on-demand sticky header",
"version": "1.2.1",
"version": "1.2.2",
"author": {
"name": "Mark Goodyear",
"url": "http://markgoodyear.com",
Expand Down
12 changes: 7 additions & 5 deletions src/headhesive.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
if (typeof define === 'function' && define.amd) {
define([], function () {
return factory();
});
} else if (typeof exports === 'object') {
module.exports = factory(root);
module.exports = factory();
} else {
root.Headhesive = factory(root);
root.Headhesive = factory();
}
})(this, function (root) {
})(this, function () {
'use strict';

//= include helpers.js
Expand Down
4 changes: 2 additions & 2 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ var _getScrollY = function () {
*/
var _getElemY = function (elem, side) {
var pos = 0;
var elemHeight = elem.offsetHeight
var elemHeight = elem.offsetHeight;

while (elem) {
pos += elem.offsetTop;
Expand All @@ -78,4 +78,4 @@ var _getElemY = function (elem, side) {
}

return pos;
}
};

0 comments on commit a71e317

Please sign in to comment.