Made backspace work on input history items
This commit is contained in:
parent
8a790a6fe2
commit
b7cafc5327
@ -48,6 +48,8 @@ var MessageInput = React.createClass({
|
||||
inputHistoryActions.increment();
|
||||
} else if (e.which === 40) {
|
||||
inputHistoryActions.decrement();
|
||||
} else if (e.key === 'Backspace' || e.key === 'Delete') {
|
||||
inputHistoryActions.reset();
|
||||
} else if (e.key === 'Unidentified') {
|
||||
inputHistoryActions.reset();
|
||||
}
|
||||
|
@ -2,6 +2,8 @@ var EventEmitter = require('events').EventEmitter;
|
||||
|
||||
var _ = require('lodash');
|
||||
|
||||
var ws = new WebSocket('ws://' + window.location.host + '/ws');
|
||||
|
||||
var socket = {
|
||||
send: function(type, data) {
|
||||
ws.send(JSON.stringify({ type: type, request: data }));
|
||||
@ -10,8 +12,6 @@ var socket = {
|
||||
|
||||
_.extend(socket, EventEmitter.prototype);
|
||||
|
||||
var ws = new WebSocket('ws://' + window.location.host + '/ws');
|
||||
|
||||
ws.onopen = function() {
|
||||
socket.emit('connect');
|
||||
};
|
||||
|
@ -31,8 +31,10 @@ var inputHistoryStore = Reflux.createStore({
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
if (index !== -1) {
|
||||
index = -1;
|
||||
this.trigger(history[index]);
|
||||
}
|
||||
},
|
||||
|
||||
increment: function() {
|
||||
|
@ -20,7 +20,7 @@ type Server struct {
|
||||
type Channel struct {
|
||||
Server string `json:"server"`
|
||||
Name string `json:"name"`
|
||||
Users []string `json:"users"`
|
||||
Users []string `json:"users,omitempty"`
|
||||
Topic string `json:"topic,omitempty"`
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user