Start on support for messaging a brand new contact
This commit is contained in:
parent
d3d84f3124
commit
613dc3bedd
3 changed files with 20 additions and 1 deletions
|
@ -56,9 +56,17 @@ var Whisper = Whisper || {};
|
||||||
|
|
||||||
this.typeahead_view.$el.appendTo(this.$el.find('.contacts'));
|
this.typeahead_view.$el.appendTo(this.$el.find('.contacts'));
|
||||||
this.typeahead_collection.fetch();
|
this.typeahead_collection.fetch();
|
||||||
|
|
||||||
|
this.new_contact = new Whisper.ConversationListItemView({
|
||||||
|
model: new Whisper.Conversation({
|
||||||
|
active_at: null
|
||||||
|
})
|
||||||
|
}).render();
|
||||||
|
this.$el.find('.new-contact').append(this.new_contact.el);
|
||||||
},
|
},
|
||||||
|
|
||||||
filterContacts: function(query) {
|
filterContacts: function(query) {
|
||||||
|
this.new_contact.model.set('name', query);
|
||||||
if (query.length) {
|
if (query.length) {
|
||||||
this.typeahead_view.collection.reset(
|
this.typeahead_view.collection.reset(
|
||||||
this.typeahead_collection.typeahead(query)
|
this.typeahead_collection.typeahead(query)
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.new-contact,
|
||||||
.typeahead {
|
.typeahead {
|
||||||
.last-message, .last-timestamp {
|
.last-message, .last-timestamp {
|
||||||
display: none;
|
display: none;
|
||||||
|
@ -15,3 +16,7 @@
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.new-contact .contact::before {
|
||||||
|
content: 'New contact'
|
||||||
|
}
|
||||||
|
|
|
@ -4,11 +4,17 @@
|
||||||
.contact .checkbox {
|
.contact .checkbox {
|
||||||
display: none; }
|
display: none; }
|
||||||
|
|
||||||
.typeahead .last-message, .typeahead .last-timestamp {
|
.new-contact .last-message, .new-contact .last-timestamp,
|
||||||
|
.typeahead .last-message,
|
||||||
|
.typeahead .last-timestamp {
|
||||||
display: none; }
|
display: none; }
|
||||||
|
.new-contact .contact .checkbox,
|
||||||
.typeahead .contact .checkbox {
|
.typeahead .contact .checkbox {
|
||||||
display: inline-block; }
|
display: inline-block; }
|
||||||
|
|
||||||
|
.new-contact .contact::before {
|
||||||
|
content: "New contact"; }
|
||||||
|
|
||||||
@font-face {
|
@font-face {
|
||||||
font-family: 'Roboto';
|
font-family: 'Roboto';
|
||||||
src: url("/fonts/Roboto-Regular.ttf") format("truetype"); }
|
src: url("/fonts/Roboto-Regular.ttf") format("truetype"); }
|
||||||
|
|
Loading…
Reference in a new issue