Skip to content

Commit

Permalink
Bugfix: Only add event handler if link exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswyse committed Jul 23, 2013
1 parent 75aec1e commit 0fb276b
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion dist/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="row big">
<div id="example1" class="imageReveal">
<img src="images/1-before.jpg" title="Sup">
<img src="images/1-after.jpg" title="After">
<img src="images/1-after.jpg" title="After" data-link="http://www.apple.com">
</div>
</div>

Expand Down Expand Up @@ -65,6 +65,7 @@
startPosition: 0.25,
showCaption: true,
captionChange: 0.5,
linkCaption: true,
width: 500,
height: 500
});
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.imageReveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
.css('cursor', 'pointer')
.data('link', $el[i].before.data('link'))
.on('click', function() {
window.location = $el[i].caption.data('link');
if($el[i].caption.data('link')) window.location = $el[i].caption.data('link');
return false;
});
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.imageReveal.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 imageReveal.jquery.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imageReveal",
"version": "0.1.7",
"version": "0.1.8",
"title": "jQuery Image Reveal",
"description": "A Simple Before/After Image Viewer",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jquery-image-reveal",
"description": "jQuery Image Reveal - A Simple Before/After Image Viewer",
"version": "0.1.7",
"version": "0.1.8",
"homepage": "http://github.com/lemoncreative/jquery-image-reveal",
"author": {
"name": "Lemon Creative",
Expand Down
3 changes: 2 additions & 1 deletion src/demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="row big">
<div id="example1" class="imageReveal">
<img src="images/1-before.jpg" title="Sup">
<img src="images/1-after.jpg" title="After">
<img src="images/1-after.jpg" title="After" data-link="http://www.apple.com">
</div>
</div>

Expand Down Expand Up @@ -65,6 +65,7 @@
startPosition: 0.25,
showCaption: true,
captionChange: 0.5,
linkCaption: true,
width: 500,
height: 500
});
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.imageReveal.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
.css('cursor', 'pointer')
.data('link', $el[i].before.data('link'))
.on('click', function() {
window.location = $el[i].caption.data('link');
if($el[i].caption.data('link')) window.location = $el[i].caption.data('link');
return false;
});
}
Expand Down

0 comments on commit 0fb276b

Please sign in to comment.