Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Added fix for ie 8 compatibility mode and changed options extension #15

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions jquery.watermark.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/

(function ($) {
var old_ie = $.browser.msie && $.browser.version < 8;
var old_ie = $.browser.msie && (!document.documentMode || $.browser.version < 8);
var hard_left = 4;
$.watermarker = function () { };
$.extend($.watermarker, {
Expand Down Expand Up @@ -42,7 +42,7 @@

$.fn.watermark = function (text, options) {
var options, elems;
options = $.extend($.watermarker.defaults, options);
options = $.extend({}, $.watermarker.defaults, options);
elems = this.filter('textarea, input:not(:checkbox,:radio,:file,:submit,:reset)');

if (options.fallback && $.watermarker.html5_support())
Expand Down Expand Up @@ -120,7 +120,9 @@
$.watermarker.checkVal($elem.val(), watermark_label);

watermark_label.click(function () {
$($(this).data('jq_watermark_element')).trigger('click').trigger('focus');
$($(this).data('jq_watermark_element'))
.not('[readonly], [disabled]').filter(':visible')
.trigger('click').trigger('focus');
}
);

Expand All @@ -146,5 +148,6 @@

$(function () {
$('.jq_watermark').watermark();
$('input[placeholder]:visible').watermark();
})
})(jQuery);
2 changes: 1 addition & 1 deletion jquery.watermark.min.js

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