Fix reset predefined answers selectbox index

This commit is contained in:
Dmitriy Simushev 2012-10-12 09:07:42 +00:00
parent 14eed1072d
commit a310180709
2 changed files with 2 additions and 2 deletions

View File

@ -13,4 +13,4 @@ name:a}}],function(a){a.errorCode&&this.handleError(a,"cannot rename")}.bind(thi
this.handleError(a,"cannot close")},setupAvatar:function(a){$("avatarwnd")&&this.thread.user&&this.view.updateAvatar(this.options.webimRoot,a.imageLink)},updateMessages:function(a){a.lastId&&(this.thread.lastid=a.lastId);this.view.displayMessages(a.messages);this.view.clearStatus();0<a.messages.length&&(this.skipNextSound||(a=$("soundimg"),(null==a||a.className.match(/\bisound\b/))&&playSound(this.options.webimRoot+"/sounds/new_message.wav")),this.focused||window.focus());this.skipNextSound=!1},updateFunctionBuilder:function(){return[{"function":"update",
arguments:{"return":{typing:"typing",canPost:"canPost"},references:{},threadId:this.thread.threadid,token:this.thread.token,lastId:this.thread.lastid,typed:this.message&&""!=this.message.value,user:this.thread.user}}]},updateChatState:function(a){if(a.errorCode)this.handleError(a,"refresh failed");else if("undefined"!=typeof a.typing&&this.view.showTyping(a.typing),"undefined"!=typeof a.canPost&&(a.canPost&&!this.ownThread||this.ownThread&&!a.canPost))window.location.href=window.location.href},isSendkey:function(a,
b){return 13==b&&(a||this.options.ignorectrl)||10==b},handleKeyDown:function(a){a?(ctrl=a.ctrlKey,a=a.which):(a=event.keyCode,ctrl=event.ctrlKey);return this.message&&this.isSendkey(ctrl,a)?(a=this.message.value,this.options.ignorectrl&&(a=a.replace(/[\r\n]+$/,"")),this.postMessage(a),!1):!0},handleError:function(a){a.errorCode?this.view.setStatus(a.errorMessage):this.view.setStatus("reconnecting")},applyName:function(){this.changeName($("uname").value);this.view.hideNameField();this.view.updateUserName($("uname").value)},
showNameField:function(){this.view.showNameField()},selectPredefinedAnswer:function(a){var b=a.selectedIndex;0!=b&&(this.view.displayPredefinedAnswer(b-1),this.view.resetSelect(a))},toggleSound:function(){var a=$("soundimg");a&&(a.className.match(/\bisound\b/)?this.view.changeSoundButtonState(!1):this.view.changeSoundButtonState(!0))}};
showNameField:function(){this.view.showNameField()},selectPredefinedAnswer:function(a){var b=a.selectedIndex;0!=b&&(this.view.displayPredefinedAnswer(b-1),this.view.resetSelectedIndex(a))},toggleSound:function(){var a=$("soundimg");a&&(a.className.match(/\bisound\b/)?this.view.changeSoundButtonState(!1):this.view.changeSoundButtonState(!0))}};

View File

@ -396,7 +396,7 @@ ChatController.prototype = {
var index = answerSelect.selectedIndex;
if(index != 0) {
this.view.displayPredefinedAnswer(index-1);
this.view.resetSelect(answerSelect);
this.view.resetSelectedIndex(answerSelect);
}
},