Skip to content

Commit

Permalink
Updated minified version to reflect temp01’s awesome changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasbynens committed Oct 8, 2010
1 parent 593350d commit 5bfad54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions jquery.placeholder.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@

function args(elem) {
// Return an object of element attributes
var newAttrs = {}, rinlinejQuery = /^jQuery\d+$/;
$.each(elem.attributes, function(i, attr){
if( !rinlinejQuery.test(attr.name) ){
var newAttrs = {},
rinlinejQuery = /^jQuery\d+$/;
$.each(elem.attributes, function(i, attr) {
if (!rinlinejQuery.test(attr.name)) {
newAttrs[attr.name] = attr.value;
}
});
Expand All @@ -39,11 +40,11 @@
$input = $(this);
if ($input.val() === '' || $input.val() === $input.attr('placeholder')) {
if ($input.is(':password')) {
if(!$input.data('placeholder-textinput')){
if (!$input.data('placeholder-textinput')) {
try {
$replacement = $input.clone().attr({ type: 'text' });
} catch(e) {
$replacement = $('<input>').attr( $.extend(args($input[0]), {type: 'text'}) );
$replacement = $('<input>').attr($.extend(args($input[0]), { type: 'text' }));
}
$replacement
.removeAttr('name')
Expand Down
2 changes: 1 addition & 1 deletion jquery.placeholder.min.js

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

0 comments on commit 5bfad54

Please sign in to comment.