BigW Consortium Gitlab

Commit 097c283a by Mike Greiling

remove left_align setting from notification setting dropdown in favor of a pure css solution

parent 69ffa814
.notification-list-item { .notification-list-item {
line-height: 34px; line-height: 34px;
.dropdown-menu {
@extend .dropdown-menu-align-right;
}
} }
.notification { .notification {
......
...@@ -188,6 +188,10 @@ ...@@ -188,6 +188,10 @@
margin-left: 10px; margin-left: 10px;
} }
.notification-dropdown .dropdown-menu {
@extend .dropdown-menu-align-right;
}
.download-button { .download-button {
@media (max-width: $screen-md-max) { @media (max-width: $screen-md-max) {
margin-left: 0; margin-left: 0;
......
...@@ -37,11 +37,7 @@ class NotificationSettingsController < ApplicationController ...@@ -37,11 +37,7 @@ class NotificationSettingsController < ApplicationController
def render_response def render_response
render json: { render json: {
html: view_to_html_string( html: view_to_html_string("shared/notifications/_button", notification_setting: @notification_setting),
"shared/notifications/_button",
notification_setting: @notification_setting,
left_align: @notification_setting.source.nil?
),
saved: @saved saved: @saved
} }
end end
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
%br %br
.clearfix .clearfix
.form-group.pull-left.global-notification-setting .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 .clearfix
......
- left_align = local_assigns[:left_align]
- if notification_setting - if notification_setting
.dropdown.notification-dropdown .dropdown.notification-dropdown
= form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f| = form_for notification_setting, remote: true, html: { class: "inline notification-form" } do |f|
...@@ -19,7 +18,7 @@ ...@@ -19,7 +18,7 @@
= notification_title(notification_setting.level) = notification_title(notification_setting.level)
= icon("caret-down") = 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 = content_for :scripts_body do
= render "shared/notifications/custom_notifications", notification_setting: notification_setting = render "shared/notifications/custom_notifications", notification_setting: notification_setting
- 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)] }
%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)] }
- NotificationSetting.levels.each_key do |level| - NotificationSetting.levels.each_key do |level|
- next if level == "custom" - next if level == "custom"
- next if level == "global" && notification_setting.source.nil? - next if level == "global" && notification_setting.source.nil?
......
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