Skip to content

Commit

Permalink
Merge pull request mathiasbynens#278 from mathiasbynens/gh-pages
Browse files Browse the repository at this point in the history
merging to master
  • Loading branch information
amerikan committed Nov 13, 2015
2 parents 4ca9fad + 81a2c5c commit ce26d57
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
20 changes: 16 additions & 4 deletions jquery.placeholder.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* jQuery Placeholder Plugin v2.2.0
* jQuery Placeholder Plugin v2.3.0
* https://github.com/mathiasbynens/jquery-placeholder
*
* Copyright 2011, 2015 Mathias Bynens
Expand Down Expand Up @@ -152,9 +152,21 @@

// Clear placeholder values upon page reload
$(window).bind('beforeunload.placeholder', function() {
$('.'+settings.customClass).each(function() {
this.value = '';
});

var clearPlaceholders = true;

try {
// Prevent IE javascript:void(0) anchors from causing cleared values
if (document.activeElement.toString() === 'javascript:void(0)') {
clearPlaceholders = false;
}
} catch (exception) { }

if (clearPlaceholders) {
$('.'+settings.customClass).each(function() {
this.value = '';
});
}
});
}

Expand Down
6 changes: 3 additions & 3 deletions jquery.placeholder.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 jquery.placeholder.min.js.map

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,6 +1,6 @@
{
"name": "jquery-placeholder",
"version": "2.2.0",
"version": "2.3.0",
"title": "HTML5 Placeholder jQuery Plugin",
"description": "A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet",
"author": {
Expand Down

0 comments on commit ce26d57

Please sign in to comment.