diff --git a/public/images/user/uma.jpeg b/public/images/user/uma.jpg similarity index 100% rename from public/images/user/uma.jpeg rename to public/images/user/uma.jpg diff --git a/public/images/user/wolf.jpeg b/public/images/user/wolf.jpg similarity index 100% rename from public/images/user/wolf.jpeg rename to public/images/user/wolf.jpg diff --git a/public/javascripts/mentions.js b/public/javascripts/mentions.js index 6436055bb..11a67afd7 100644 --- a/public/javascripts/mentions.js +++ b/public/javascripts/mentions.js @@ -1,11 +1,10 @@ var Mentions = { initialize: function(mentionsInput) { mentionsInput.mentionsInput(Mentions.options); - Mentions.fetchContacts(); }, fetchContacts : function(){ - $.getJSON($(".selected_contacts_link").attr("href"), function(data) { + Mentions.contacts || $.getJSON($(".selected_contacts_link").attr("href"), function(data) { Mentions.contacts = data; }); }, @@ -16,7 +15,7 @@ var Mentions = { onDataRequest: function(mode, query, callback) { var filteredResults = _.filter(Mentions.contacts, function(item) { return item.name.toLowerCase().indexOf(query.toLowerCase()) > -1 }); - callback.call(this, filteredResults); + callback.call(this, filteredResults.slice(0,5)); }, templates: { diff --git a/public/javascripts/publisher.js b/public/javascripts/publisher.js index 865a0941e..a5da460e2 100644 --- a/public/javascripts/publisher.js +++ b/public/javascripts/publisher.js @@ -118,6 +118,7 @@ var Publisher = { } } }, + createCounter: function(service){ var counter = $("#publisher .counter"); counter.remove(); @@ -205,6 +206,10 @@ var Publisher = { Mentions.initialize(Publisher.input()); + Publisher.input().bind("focus", function(){ + Mentions.fetchContacts(); + }) + if(Publisher.hiddenInput().val() === "") { Publisher.hiddenInput().val(Publisher.input().val()); } diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index 8c0429a64..84a1644be 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -985,6 +985,9 @@ label:not(.bootstrapped) :display inline :position relative :top -2px + + #status_message_fake_text + :min-height 20px .content_creation @@ -1033,6 +1036,7 @@ label:not(.bootstrapped) #publisher_textarea_wrapper #hide_publisher @include opacity(0.3) + :z-index 5 :padding 3px :position absolute :right 6px diff --git a/spec/javascripts/app/views/comment_view_spec.js b/spec/javascripts/app/views/comment_view_spec.js index dc90b74a3..66f25cb23 100644 --- a/spec/javascripts/app/views/comment_view_spec.js +++ b/spec/javascripts/app/views/comment_view_spec.js @@ -11,7 +11,7 @@ describe("app.views.Comment", function(){ }) it("doesn't have a delete link if the author is not the current user", function(){ - loginAs(_.extend(this.comment.get("author"), {diaspora_id : "notbob@bob.com"}) + loginAs(factory.author({diaspora_id : "notbob@bob.com"})) expect(this.view.render().$('.delete').length).toBe(0) }) @@ -28,7 +28,7 @@ describe("app.views.Comment", function(){ }) it("returns false if the author diaspora_id != the current user's diaspora_id", function(){ - loginAs(_.extend(this.comment.get("author"), {diaspora_id : "notbob@bob.com"}) + loginAs(factory.author({diaspora_id : "notbob@bob.com"})) expect(this.view.ownComment()).toBe(false); })