Use "once" method instead of "on"/"off" in JS message form

This commit is contained in:
Dmitriy Simushev 2014-11-06 11:02:57 +00:00
parent bffc2fd799
commit b4ab5d8cd1

View File

@ -91,12 +91,12 @@
if (msg != '') {
this.disableInput();
this.model.postMessage(msg);
Mibew.Objects.Collections.messages.once(
'multiple:add',
this.postMessageComplete,
this
);
}
Mibew.Objects.Collections.messages.on(
'multiple:add',
this.postMessageComplete,
this
);
},
/**
@ -149,11 +149,6 @@
this.enableInput();
// Always set focus on message input after message sent
this.ui.message.focus();
Mibew.Objects.Collections.messages.off(
'multiple:add',
this.postMessageComplete,
this
);
},
/**