Commit caeaf23d authored by Steffen van Bergerem's avatar Steffen van Bergerem Committed by Benjamin Neff

Replace aspect_dropdown with aspect-dropdown

parent 3df47497
......@@ -11,7 +11,7 @@ app.pages.Settings = Backbone.View.extend({
new Diaspora.ProfilePhotoUploader();
this.viewAspectSelector = new app.views.PublisherAspectSelector({
el: $(".aspect_dropdown"),
el: $(".aspect-dropdown"),
form: $("#post-default-aspects")
});
$("#update_profile_form").areYouSure();
......
......@@ -9,7 +9,7 @@
*/
app.views.AspectMembership = app.views.Base.extend({
templateName: "aspect_membership_dropdown",
className: "btn-group aspect_dropdown aspect_membership_dropdown",
className: "btn-group aspect-dropdown aspect_membership_dropdown",
subviews: {
".newAspectContainer": "aspectCreateView"
......
......@@ -101,13 +101,13 @@ app.views.Publisher = Backbone.View.extend({
});
this.viewAspectSelector = new app.views.PublisherAspectSelector({
el: this.$(".public_toggle .aspect_dropdown"),
el: this.$(".public_toggle .aspect-dropdown"),
form: form
});
this.viewGettingStarted = new app.views.PublisherGettingStarted({
firstMessageEl: this.inputEl,
visibilityEl: this.$(".public_toggle .aspect_dropdown > .dropdown-toggle"),
visibilityEl: this.$(".public_toggle .aspect-dropdown > .dropdown-toggle"),
streamEl: $("#main-stream")
});
......
.aspect_dropdown {
.aspect-dropdown {
li {
@include selectable-list;
......
......@@ -15,7 +15,7 @@ body {
.md-input,
.md-preview { background-color: $gray; }
.aspect_dropdown li a .text { color: $dropdown-link-color; }
.aspect-dropdown li a .text { color: $dropdown-link-color; }
.info .tag { background-color: $gray-light; }
......
......@@ -8,7 +8,7 @@
margin-top: -20px;
box-shadow: $card-shadow;
#edit_profile, #unblock_user_button, .aspect_dropdown {
#edit_profile, #unblock_user_button, .aspect-dropdown {
margin-top: 15px;
}
......
......@@ -53,8 +53,8 @@
.btn-toolbar {
width: 100%;
display: flex;
.btn, .aspect_dropdown{ flex-grow: 1; }
.aspect_dropdown .btn { width: 100%; }
.btn, .aspect-dropdown{ flex-grow: 1; }
.aspect-dropdown .btn { width: 100%; }
}
.btn-group:first-child { margin: 0; }
.dropdown-menu.pull-right {
......@@ -183,7 +183,7 @@
}
}
.aspect_dropdown {
.aspect-dropdown {
.radio {
min-height: 0;
padding-left: 0;
......
%div
%select.aspect_dropdown.form-control.user_aspects{"name" => "user_aspects", "data-person-id" => @person.id}
%select.aspect-dropdown.form-control.user_aspects{"name" => "user_aspects", "data-person-id" => @person.id}
%option{value: 'list_cover', class: 'list_cover', disabled: 'true', selected: 'true'}
= t("contacts.index.add_contact")
- contact = current_user.contact_for(@person)
......
......@@ -6,7 +6,7 @@
dropdown_css["data-content"] = t("shared.public_explain.visibility_dropdown")
end
.btn-group.aspect_dropdown
.btn-group.aspect-dropdown
%button.btn.btn-default.dropdown-toggle{dropdown_css}
- if public_selected?(selected_aspects)
%i.entypo-globe.small#visibility-icon
......
......@@ -36,7 +36,7 @@ Feature: Change settings
Scenario: Change my post default aspects
When I go to the stream page
And I expand the publisher
Then I should see "All aspects" within ".aspect_dropdown"
Then I should see "All aspects" within ".aspect-dropdown"
When I go to the edit user page
And I press the aspect dropdown
And I toggle the aspect "Family"
......@@ -44,7 +44,7 @@ Feature: Change settings
And I press "Change" within "#post-default-aspects"
And I go to the stream page
And I expand the publisher
Then I should see "Family" within ".aspect_dropdown"
Then I should see "Family" within ".aspect-dropdown"
Scenario: Change my post default to public
When I press the aspect dropdown
......@@ -52,7 +52,7 @@ Feature: Change settings
And I press "Change" within "#post-default-aspects"
And I go to the stream page
And I expand the publisher
Then I should see "Public" within ".aspect_dropdown"
Then I should see "Public" within ".aspect-dropdown"
Scenario: exporting profile data
When I click on the first selector "#account_data a"
......
......@@ -31,7 +31,7 @@ Scenario: search for a user in background
And I search for "user@pod.tld"
And a person with ID "user@pod.tld" has been discovered
Then I should see "user@pod.tld" within ".stream .info.diaspora_handle"
And I should see a ".aspect_dropdown" within ".stream"
And I should see a ".aspect-dropdown" within ".stream"
Scenario: search for a not searchable user
When I sign in as "carol@example.com"
......
......@@ -42,7 +42,7 @@ Feature: new user registration
When I confirm the alert after I follow "awesome_button"
Then I should be on the stream page
And the publisher should be expanded
And I should see "Public" within ".aspect_dropdown"
And I should see "Public" within ".aspect-dropdown"
Scenario: new user without any tags posts first status message
When I confirm the alert after I follow "awesome_button"
......
module AspectCukeHelpers
def click_aspect_dropdown
find(".aspect_dropdown .dropdown-toggle").trigger "click"
find(".aspect-dropdown .dropdown-toggle").trigger "click"
end
def toggle_aspect(a_name)
......@@ -9,7 +9,7 @@ module AspectCukeHelpers
else
@me.aspects.where(name: a_name).pluck(:id).first
end
aspect_css = ".aspect_dropdown li[data-aspect_id='#{a_id}']"
aspect_css = ".aspect-dropdown li[data-aspect_id='#{a_id}']"
expect(page).to have_selector(aspect_css)
find(aspect_css).click
end
......
......@@ -128,7 +128,7 @@ end
When /^I select "([^"]*)" on the aspect dropdown$/ do |text|
page.execute_script(
"$('#publisher .dropdown .dropdown_list, #publisher .aspect_dropdown .dropdown-menu')
"$('#publisher .dropdown .dropdown_list, #publisher .aspect-dropdown .dropdown-menu')
.find('li').each(function(i,el){
var elem = $(el);
if ('" + text + "' == $.trim(elem.text()) ) {
......
......@@ -233,7 +233,7 @@ end
And /^I should be able to friend "([^\"]*)"$/ do |email|
user = User.find_by_email(email)
step 'I should see a ".aspect_dropdown"'
step 'I should see a ".aspect-dropdown"'
step "I should see \"#{user.name}\""
end
......
describe("app.views.AspectsDropdown", function(){
beforeEach(function() {
spec.loadFixture("bookmarklet");
this.view = new app.views.AspectsDropdown({el: $('.aspect_dropdown')});
this.view = new app.views.AspectsDropdown({el: $('.aspect-dropdown')});
});
context('_toggleCheckbox', function() {
......
......@@ -112,7 +112,7 @@ describe("app.views.Publisher", function() {
expect("#publisher").not.toHaveClass("closed");
$("#publisher").find(".publisher-textarea-wrapper").click();
expect("#publisher").not.toHaveClass("closed");
$("#publisher").find(".aspect_dropdown button").click();
$("#publisher").find(".aspect-dropdown button").click();
expect("#publisher").not.toHaveClass("closed");
});
......@@ -121,10 +121,10 @@ describe("app.views.Publisher", function() {
// that take the whole page when it detects a mobile.
// Clicking on this element should not close the publisher.
// See https://github.com/diaspora/diaspora/issues/6979.
$("#publisher").find(".aspect_dropdown").append("<div class='dropdown-backdrop'></div>")
$("#publisher").find(".aspect-dropdown").append("<div class='dropdown-backdrop'></div>")
.css({position: "fixed", left: 0, right: 0, bottom: 0, top: 0, "z-index": 990});
expect("#publisher").not.toHaveClass("closed");
$("#publisher").find(".aspect_dropdown button").click();
$("#publisher").find(".aspect-dropdown button").click();
expect("#publisher").not.toHaveClass("closed");
$("#publisher").find(".dropdown-backdrop").click();
expect("#publisher").not.toHaveClass("closed");
......@@ -403,13 +403,13 @@ describe("app.views.Publisher", function() {
describe("toggles the selected entry visually", function(){
it("click on the first aspect", function(){
this.view.$(".aspect_dropdown li.aspect_selector:first").click();
this.view.$(".aspect-dropdown li.aspect_selector:first").click();
expect($("#publisher #visibility-icon")).not.toHaveClass("entypo-globe");
expect($("#publisher #visibility-icon")).toHaveClass("entypo-lock");
});
it("click on public", function(){
this.view.$(".aspect_dropdown li.public").click();
this.view.$(".aspect-dropdown li.public").click();
expect($("#publisher #visibility-icon")).toHaveClass("entypo-globe");
expect($("#publisher #visibility-icon")).not.toHaveClass("entypo-lock");
});
......@@ -430,7 +430,7 @@ describe("app.views.Publisher", function() {
expect(selected.length).toBe(1);
expect(selected.first().val()).toBe('all_aspects');
var evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:last') });
var evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:last') });
this.view.viewAspectSelector.toggleAspect(evt);
selected = $('input[name="aspect_ids[]"]');
......@@ -441,20 +441,20 @@ describe("app.views.Publisher", function() {
it("toggles the same item", function() {
expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(0);
var evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:last') });
var evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:last') });
this.view.viewAspectSelector.toggleAspect(evt);
expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(1);
evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:last') });
evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:last') });
this.view.viewAspectSelector.toggleAspect(evt);
expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(0);
});
it("keeps other fields with different values", function() {
$('.dropdown-menu').append('<li data-aspect_id="99" class="aspect_selector" />');
var evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:eq(-2)') });
var evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:eq(-2)') });
this.view.viewAspectSelector.toggleAspect(evt);
evt = $.Event("click", { target: $('.aspect_dropdown li.aspect_selector:eq(-1)') });
evt = $.Event("click", { target: $('.aspect-dropdown li.aspect_selector:eq(-1)') });
this.view.viewAspectSelector.toggleAspect(evt);
expect($('input[name="aspect_ids[]"][value="42"]').length).toBe(1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment