X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/276656dcc680e1a35103d310dea046152ddc3785..24e09bc235b3ff6e659e901dfbdbcc23e6e14ba7:/wolnelektury/static/js/dialogs.js diff --git a/wolnelektury/static/js/dialogs.js b/wolnelektury/static/js/dialogs.js index 0df6508eb..086a47d3d 100755 --- a/wolnelektury/static/js/dialogs.js +++ b/wolnelektury/static/js/dialogs.js @@ -79,6 +79,7 @@ $('.target', $window).text(response.message); setTimeout(function() { $window.jqmHide() }, 1000); $form.submit(); + location.reload(); } else { $('.error', $window).remove(); @@ -145,10 +146,52 @@ }; var ajaxable_callbacks = { - 'social-book-sets': update_star + 'social-book-sets': location.reload }; + + // check placeholder browser support + if (!Modernizr.input.placeholder) + { + // set placeholder values + $(this).find('[placeholder]').each(function() + { + $(this).val( $(this).attr('placeholder') ).addClass('placeholder'); + }); + + // focus and blur of placeholders + $('[placeholder]').focus(function() + { + if ($(this).val() == $(this).attr('placeholder')) + { + $(this).val(''); + $(this).removeClass('placeholder'); + } + }).blur(function() + { + if ($(this).val() == '' || $(this).val() == $(this).attr('placeholder')) + { + $(this).val($(this).attr('placeholder')); + $(this).addClass('placeholder'); + } + }); + + // remove placeholders on submit + $('[placeholder]').closest('form').submit(function() + { + $(this).find('[placeholder]').each(function() + { + if ($(this).val() == $(this).attr('placeholder')) + { + $(this).val(''); + } + }) + }); + } + + + }); })(jQuery)