﻿(function (a) { a.fn.listenForEnter = function () { return this.each(function () { a(this).focus(function () { a(this).data("safeEnter_InAutocomplete", false) }); a(this).keypress(function (b) { var c = b.keyCode ? b.keyCode : b.which; switch (c) { case 13: if (!a(this).data("safeEnter_InAutocomplete") || !a(this).is("input[type=text]") || a.browser.opera) { a(this).trigger("pressedEnter", b) } a(this).data("safeEnter_InAutocomplete", false); break; case 40: case 38: case 34: case 33: a(this).data("safeEnter_InAutocomplete", true); break; default: a(this).data("safeEnter_InAutocomplete", false); break } }) }) }; a.fn.clickOnEnter = function (b) { return this.each(function () { a(this).listenForEnter().bind("pressedEnter", function () { a(b).click() }) }) } })(jQuery)
