Merge branch '25510-fix-notifications-dropdown-alignment' into 'master'

Fix alignment for notification settings ajax response

## What does this MR do?

Fixes a issue where an AJAX call to change your global notification settings will return an html partial which has the incorrect dropdown alignment class, in some cases causing the dropdown menu to become obscured on the left side of the screen.

## Are there points in the code the reviewer needs to double check?

## Screenshots (if relevant)

See issue #25510 for a screenshot of the problem and steps to reproduce.

## Does this MR meet the acceptance criteria?

- [ ] [Changelog entry](https://docs.gitlab.com/ce/development/changelog.html) added
- [ ] ~~[Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)~~
- [ ] ~~API support added~~
- Tests
  - [ ] ~~Added for this feature/bug~~
  - [ ] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if it does - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)

## What are the relevant issue numbers?

Closes #25510

See merge request !8024
This commit is contained in:
Fatih Acet 2016-12-12 09:53:02 +00:00
commit db9e1635d0
5 changed files with 11 additions and 5 deletions

View File

@ -1,5 +1,9 @@
.notification-list-item {
line-height: 34px;
.dropdown-menu {
@extend .dropdown-menu-align-right;
}
}
.notification {

View File

@ -188,6 +188,10 @@
margin-left: 10px;
}
.notification-dropdown .dropdown-menu {
@extend .dropdown-menu-align-right;
}
.download-button {
@media (max-width: $screen-md-max) {
margin-left: 0;

View File

@ -30,7 +30,7 @@
%br
.clearfix
.form-group.pull-left.global-notification-setting
= render 'shared/notifications/button', notification_setting: @global_notification_setting, left_align: true
= render 'shared/notifications/button', notification_setting: @global_notification_setting
.clearfix

View File

@ -1,4 +1,3 @@
- left_align = local_assigns[:left_align]
- if notification_setting
.dropdown.notification-dropdown
= form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f|
@ -19,7 +18,7 @@
= notification_title(notification_setting.level)
= icon("caret-down")
= render "shared/notifications/notification_dropdown", notification_setting: notification_setting, left_align: left_align
= render "shared/notifications/notification_dropdown", notification_setting: notification_setting
= content_for :scripts_body do
= render "shared/notifications/custom_notifications", notification_setting: notification_setting

View File

@ -1,5 +1,4 @@
- left_align = local_assigns[:left_align]
%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting), ("dropdown-menu-align-right" unless left_align)] }
%ul.dropdown-menu.dropdown-menu-no-wrap.dropdown-menu-selectable.dropdown-menu-large{ role: "menu", class: [notifications_menu_identifier("dropdown", notification_setting)] }
- NotificationSetting.levels.each_key do |level|
- next if level == "custom"
- next if level == "global" && notification_setting.source.nil?