diff --git a/src/browser/js/libs/jquery.fake-input.js b/src/browser/js/libs/jquery.fake-input.js index 5ef91318..a2cfd8f2 100644 --- a/src/browser/js/libs/jquery.fake-input.js +++ b/src/browser/js/libs/jquery.fake-input.js @@ -62,31 +62,35 @@ } - self.on('focus',function(){ - self.attr('tabindex','-1') - var i = $('') - .prependTo(self) - .val(self.value) - .focus() - .change(function(){ - self.val($(this).val()) + if (!options.disabled) { + + self.on('focus',function(){ + self.attr('tabindex','-1') + var i = $('') + .prependTo(self) + .val(self.value) + .focus() + .change(function(){ + self.val($(this).val()) + i.blur() + }) + i.blur(function(){ + self.attr('tabindex','0') + i.remove() + $(document).off('.fakeInput') + }) + $(document).on('touchstart.fakeInput mousedown.fakeInput',function(e){ + if (e.originalEvent.target!=i[0] && !(e.originalEvent.sourceCapabilities && e.originalEvent.sourceCapabilities.firesTouchEvents)) { i.blur() - }) - i.blur(function(){ - self.attr('tabindex','0') - i.remove() - $(document).off('.fakeInput') - }) - $(document).on('touchstart.fakeInput mousedown.fakeInput',function(e){ - if (e.originalEvent.target!=i[0] && !(e.originalEvent.sourceCapabilities && e.originalEvent.sourceCapabilities.firesTouchEvents)) { - i.blur() - } - }).on('keydown.fakeInput', function(e){ - if (e.keyCode==13) i.change() - if (e.keyCode==27) i.off('change').blur() + } + }).on('keydown.fakeInput', function(e){ + if (e.keyCode==13) i.change() + if (e.keyCode==27) i.off('change').blur() + }) + }) - }) + } return self