Skip to content

Commit

Permalink
Cleaned up, bumped version number
Browse files Browse the repository at this point in the history
  • Loading branch information
d-oliveros committed Jan 12, 2015
1 parent 91a7784 commit 95a9d35
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-sticky",
"version": "1.7.6",
"version": "1.7.8",
"homepage": "https://github.com/d-oliveros/angular-sticky",
"authors": [
"David Oliveros <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion dist/sticky.min.js

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

11 changes: 5 additions & 6 deletions lib/sticky.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@

if(isSticking){
var parent = window.getComputedStyle(elem.parentElement, null),
initialOffsetWidth = elem.parentElement.offsetWidth
- parent.getPropertyValue('padding-right').replace('px', '')
- parent.getPropertyValue('padding-left').replace('px', '');
initialOffsetWidth = elem.parentElement.offsetWidth -
parent.getPropertyValue('padding-right').replace('px', '') -
parent.getPropertyValue('padding-left').replace('px', '');

$elem.css('width', initialOffsetWidth+'px');
}
Expand Down Expand Up @@ -153,10 +153,10 @@
$body.addClass(bodyClass);
}

if(stickyClass){
if ( stickyClass ) {
$elem.addClass(stickyClass);
}

$elem
.css('width', elem.offsetWidth+'px')
.css('position', 'fixed')
Expand All @@ -169,7 +169,6 @@
}

function unstickElement() {
//$elem[0].removeAttribute("style");
$elem.attr('style', $elem.initialStyle);
isSticking = false;

Expand Down
2 changes: 1 addition & 1 deletion test/demo.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!doctype html>
<html>
<head>
<title>Angular-Sticky Demo v1.7.6</title>
<title>Angular-Sticky Demo v1.7.8</title>

<style>
body {
Expand Down

0 comments on commit 95a9d35

Please sign in to comment.