auto expand post preview

This commit is contained in:
Steffen van Bergerem 2013-08-05 14:20:48 +02:00
parent 1639ae2b31
commit 8a8fb10b18
5 changed files with 21 additions and 0 deletions

View file

@ -25,6 +25,7 @@
* Change image to ajax-loader when closing lightbox [#3229](https://github.com/diaspora/diaspora/issues/3229) * Change image to ajax-loader when closing lightbox [#3229](https://github.com/diaspora/diaspora/issues/3229)
* Fix pointer cursor on the file upload button [#4349](https://github.com/diaspora/diaspora/pull/4349) * Fix pointer cursor on the file upload button [#4349](https://github.com/diaspora/diaspora/pull/4349)
* Resize preview button [#4355](https://github.com/diaspora/diaspora/pull/4355) * Resize preview button [#4355](https://github.com/diaspora/diaspora/pull/4355)
* Don't collapse the post preview [#4346](https://github.com/diaspora/diaspora/issues/4346)
## Features ## Features
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252) * Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)

View file

@ -202,6 +202,7 @@ app.views.Publisher = Backbone.View.extend(_.extend(
modifyPostPreview : function(post) { modifyPostPreview : function(post) {
post.addClass('post_preview'); post.addClass('post_preview');
$('.collapsible',post).removeClass('collapsed').addClass('opened');
$('a.delete.remove_post',post).hide(); $('a.delete.remove_post',post).hide();
$('a.like, a.focus_comment_textarea',post).removeAttr("href"); $('a.like, a.focus_comment_textarea',post).removeAttr("href");
$('a.like',post).addClass("like_preview"); $('a.like',post).addClass("like_preview");

View file

@ -34,6 +34,15 @@ Feature: preview posts in the stream
Then "I like rocks" should be post 1 Then "I like rocks" should be post 1
And I should not see "This preview rocks" And I should not see "This preview rocks"
Scenario: preview a very long message
Given I expand the publisher
When I insert an extremely long status message
And I press "Preview"
Then the preview should not be collapsed
When I press "Share"
Then the post should be collapsed
Scenario: preview a photo with text Scenario: preview a photo with text
Given I expand the publisher Given I expand the publisher
When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload" When I attach the file "spec/fixtures/button.png" to hidden "file" within "#file-upload"

View file

@ -1,3 +1,9 @@
Then /^the first post should be a preview$/ do Then /^the first post should be a preview$/ do
find(".post_preview .post-content").text.should == first_post_text find(".post_preview .post-content").text.should == first_post_text
end end
Then /^the preview should not be collapsed$/ do
find(".post_preview").should_not have_selector('.collapsed')
find(".post_preview").should have_selector('.opened')
end

View file

@ -66,6 +66,10 @@ When /^I post an extremely long status message$/ do
click_and_post("I am a very interesting message " * 64) click_and_post("I am a very interesting message " * 64)
end end
When /^I insert an extremely long status message$/ do
fill_in 'status_message_fake_text', :with => "I am a very interesting message " * 64
end
When /^I open the show page of the "([^"]*)" post$/ do |post_text| When /^I open the show page of the "([^"]*)" post$/ do |post_text|
visit post_path_by_content(post_text) visit post_path_by_content(post_text)
end end