Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging to master #278

Merged
merged 3 commits into from
Nov 13, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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