Add scrollbar to aspect dropdowns

closes #8213
closes #7696

Co-authored-by: Hank Grabowski <hankgrabowski@gmail.com>
Co-authored-by: Thorsten Claus <thorstenclaus@web.de>
This commit is contained in:
Gayathrir1666 2018-04-15 18:51:25 +05:30 committed by Jonne Haß
parent a420ba2cfc
commit ef9e764f7a
8 changed files with 12 additions and 9 deletions

View file

@ -11,6 +11,7 @@
* Bump mimemagic [#8231](https://github.com/diaspora/diaspora/pull/8231) * Bump mimemagic [#8231](https://github.com/diaspora/diaspora/pull/8231)
* Removed support for defunct Uni Heidelberg OSM tile server, Mapbox is now required if you want to show maps [#8215](https://github.com/diaspora/diaspora/pull/8215) * Removed support for defunct Uni Heidelberg OSM tile server, Mapbox is now required if you want to show maps [#8215](https://github.com/diaspora/diaspora/pull/8215)
* Render only two fractional digits in the posts per user/day admin statistics [#8227](https://github.com/diaspora/diaspora/pull/8227) * Render only two fractional digits in the posts per user/day admin statistics [#8227](https://github.com/diaspora/diaspora/pull/8227)
* Make aspect dropdowns scrollable [#8213](https://github.com/diaspora/diaspora/pull/8213)
## Features ## Features
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132) * Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)

View file

@ -16,10 +16,8 @@ app.views.AspectMembership = app.views.Base.extend({
}, },
events: { events: {
"click ul.aspect_membership.dropdown-menu > li.aspect_selector" "click ul.aspect-membership.dropdown-menu > li.aspect_selector": "_clickHandler",
: "_clickHandler", "keypress ul.aspect-membership.dropdown-menu > li.aspect_selector": "_clickHandler"
"keypress ul.aspect_membership.dropdown-menu > li.aspect_selector"
: "_clickHandler"
}, },
initialize: function(opts) { initialize: function(opts) {

View file

@ -21,3 +21,7 @@
} }
} }
} }
.aspect-membership {
max-height: 300px;
overflow: auto;
}

View file

@ -13,7 +13,7 @@
<span class="caret" /> <span class="caret" />
</button> </button>
<ul class="dropdown-menu aspect_membership pull-right" unselectable="on"> <ul class="dropdown-menu aspect-membership pull-right" unselectable="on">
{{#each aspects}} {{#each aspects}}
<li <li
{{#if membership}} {{#if membership}}

View file

@ -1,5 +1,5 @@
<li class="hoverable"> <li class="hoverable">
<a class="selectable toggle_selector" href="#"> <a class="selectable toggle_selector aspect-membership" href="#">
{{ t "aspect_navigation.select_all" }} {{ t "aspect_navigation.select_all" }}
</a> </a>
</li> </li>

View file

@ -22,7 +22,7 @@
- else - else
= t("shared.aspect_dropdown.toggle", count: selected_aspects.size) = t("shared.aspect_dropdown.toggle", count: selected_aspects.size)
%span.caret %span.caret
%ul.dropdown-menu.pull-right{unSelectable: "on"} %ul.dropdown-menu.aspect-membership.pull-right{unSelectable: "on"}
%li.public.radio{"data-aspect_id" => "public", :class => ("selected" if public_selected?(selected_aspects))} %li.public.radio{"data-aspect_id" => "public", :class => ("selected" if public_selected?(selected_aspects))}
%a %a

View file

@ -115,7 +115,7 @@ describe NotificationsController, :type => :controller do
it "should not provide a contacts menu for standard notifications" do it "should not provide a contacts menu for standard notifications" do
FactoryGirl.create(:notification, :recipient => alice, :target => @post) FactoryGirl.create(:notification, :recipient => alice, :target => @post)
get :index, params: {per_page: 5} get :index, params: {per_page: 5}
expect(Nokogiri(response.body).css('.aspect_membership')).to be_empty expect(Nokogiri(response.body).css(".aspect-membership")).to be_empty
end end
it "should provide a contacts menu for start sharing notifications" do it "should provide a contacts menu for start sharing notifications" do

View file

@ -10,6 +10,6 @@ describe("app.pages.GettingStarted", function() {
it("renders aspect membership dropdown", function() { it("renders aspect membership dropdown", function() {
this.view.render(); this.view.render();
expect($("ul.dropdown-menu.aspect_membership").length).toEqual(1); expect($("ul.dropdown-menu.aspect-membership").length).toEqual(1);
}); });
}); });