Added KeyDown event to AjaxEditBox
This commit is contained in:
@@ -8,13 +8,24 @@
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#<%=this.TextInput.ClientID%>').keydown(function (e) {
|
||||
// reset timer if set
|
||||
if (<%=this.ClientID%>_onChangingTimer != null) {
|
||||
clearTimeout(<%=this.ClientID%>_onChangingTimer);
|
||||
<%=this.ClientID%>_onChangingTimer = setTimeout(function() { <%=this.ClientID%>_fireOnChanging(); }, 500);
|
||||
} else {
|
||||
// otherwise set new timer with a more generous timeout on keydown in general
|
||||
<%=this.ClientID%>_onChangingTimer = setTimeout(function () { <%=this.ClientID%>_fireOnChanging(); }, 500);
|
||||
|
||||
if (e.keyCode != 9) { // tab key
|
||||
|
||||
// reset timer if set
|
||||
if (<%=this.ClientID%>_onChangingTimer != null) {
|
||||
clearTimeout(<%=this.ClientID%>_onChangingTimer);
|
||||
<%=this.ClientID%>_onChangingTimer = setTimeout(function() { <%=this.ClientID%>_fireOnChanging(); }, 500);
|
||||
} else {
|
||||
// otherwise set new timer with a more generous timeout on keydown in general
|
||||
<%=this.ClientID%>_onChangingTimer = setTimeout(function() { <%=this.ClientID%>_fireOnChanging(); }, 500);
|
||||
}
|
||||
|
||||
<%
|
||||
if (!string.IsNullOrEmpty(this.OnKeyDown))
|
||||
{
|
||||
Response.Write(this.OnKeyDown + "(e.keyCode);");
|
||||
}
|
||||
%>
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ namespace Swarmops.Frontend.Controls.Base
|
||||
public string Cookie { set; get; }
|
||||
public string OnChange { get; set; }
|
||||
public string OnChanging { get; set; }
|
||||
public string OnKeyDown { get; set; }
|
||||
public string AjaxCallbackUrl { set; get; }
|
||||
public TextBoxMode Mode { get; set; }
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@
|
||||
<div title="<img src='/Images/Icons/iconshock-lock-256px.png' height='64' width='64' />">
|
||||
<h2><span class="spanModalEditingPersonName">PERSONNAME</span>: <asp:Label runat="server" ID="MasterLabelEditPersonHeaderSecurity" Text="#Your Security#"/></h2>
|
||||
<div class="entryFields">
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonCurrentPassword" runat="server" Mode="Password" OnChanging="masterPersonEditorOnSecurityPasswordChanging" Cookie="CurrentPassword" AjaxCallbackUrl="" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonCurrentPassword" runat="server" Mode="Password" OnKeyDown="masterPersonEditorOnSecurityPasswordKeyDown" OnChanging="masterPersonEditorOnSecurityPasswordChanging" Cookie="CurrentPassword" AjaxCallbackUrl="" />​<br/>
|
||||
<div class="divMasterPersonEditSecurityRolldown" style="display:none"><Swarmops5:AjaxToggleSlider ID="MasterEditPerson2FA" runat="server" OnChange="masterPersonEditorOnFieldChange" Cookie="2FA" AjaxCallbackUrl="" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonNewPassword1" runat="server" Mode="Password" OnChange="masterPersonEditorOnFieldChange" Cookie="Phone" AjaxCallbackUrl="" />​<br/>
|
||||
<Swarmops5:AjaxTextBox ID="MasterEditPersonNewPassword2" runat="server" Mode="Password" OnChange="masterPersonEditorOnFieldChange" Cookie="TwitterId" AjaxCallbackUrl="" />
|
||||
@@ -366,6 +366,13 @@
|
||||
|
||||
var _master_PersonEditor_SecurityShowing = false;
|
||||
|
||||
function masterPersonEditorOnSecurityPasswordKeyDown() {
|
||||
if (_master_PersonEditor_SecurityShowing) {
|
||||
$('div.divMasterPersonEditSecurityRolldown').slideUp();
|
||||
_master_PersonEditor_SecurityShowing = false;
|
||||
}
|
||||
}
|
||||
|
||||
function masterPersonEditorOnSecurityPasswordChanging(newValue, cookie, controlName) {
|
||||
|
||||
if (_master_PersonEditor_SecurityShowing) {
|
||||
|
||||
Reference in New Issue
Block a user