diff options
| -rw-r--r-- | app/assets/javascripts/subscription.js.coffee | 7 | ||||
| -rw-r--r-- | app/assets/stylesheets/pages/labels.scss | 15 | ||||
| -rw-r--r-- | app/views/projects/labels/_label.html.haml | 8 | ||||
| -rw-r--r-- | features/steps/project/issues/labels.rb | 2 |
4 files changed, 18 insertions, 14 deletions
diff --git a/app/assets/javascripts/subscription.js.coffee b/app/assets/javascripts/subscription.js.coffee index 6ebd0750ffd..e4b7a3172ec 100644 --- a/app/assets/javascripts/subscription.js.coffee +++ b/app/assets/javascripts/subscription.js.coffee @@ -3,22 +3,19 @@ class @Subscription $container = $(container) @url = $container.attr('data-url') @subscribe_button = $container.find('.subscribe-button') - @subscribe_icon = $container.find('.subscribe-icon') @subscription_status = $container.find('.subscription-status') @subscribe_button.unbind('click').click(@toggleSubscription) - @subscribe_icon.unbind('click').click(@toggleSubscription) toggleSubscription: (event) => btn = $(event.currentTarget) action = btn.find('span').text() current_status = @subscription_status.attr('data-status') - btn.prop('disabled', true) + btn.addClass('disabled') $.post @url, => - btn.prop('disabled', false) + btn.removeClass('disabled') status = if current_status == 'subscribed' then 'unsubscribed' else 'subscribed' @subscription_status.attr('data-status', status) - @subscribe_icon.attr('data-original-title', status) action = if status == 'subscribed' then 'Unsubscribe' else 'Subscribe' btn.find('span').text(action) @subscription_status.find('>div').toggleClass('hidden') diff --git a/app/assets/stylesheets/pages/labels.scss b/app/assets/stylesheets/pages/labels.scss index 0e4468ad2c7..5dab9999059 100644 --- a/app/assets/stylesheets/pages/labels.scss +++ b/app/assets/stylesheets/pages/labels.scss @@ -53,7 +53,7 @@ .label-name { display: inline-block; width: 200px; - vertical-align: top; + vertical-align: baseline; @media (max-width: $screen-xs-min) { display: block; @@ -85,12 +85,13 @@ .prepend-left-10 { display: inline-block; - width: 45%; + width: 40%; + vertical-align: text-top; @media (max-width: $screen-xs-min) { display: block; width: 100%; - margin-left: 0px; + margin-left: 0; padding: 10px 0; } } @@ -104,7 +105,13 @@ .action-buttons { border-color: transparent; - padding: 6px + padding: 6px; + color: $gl-text-color; + vertical-align: initial; + + &.subscribe-button { + padding-left: 0; + } } i { diff --git a/app/views/projects/labels/_label.html.haml b/app/views/projects/labels/_label.html.haml index 4c144c317fd..097a65969a6 100644 --- a/app/views/projects/labels/_label.html.haml +++ b/app/views/projects/labels/_label.html.haml @@ -14,13 +14,13 @@ .label-subscription{data: {url: toggle_subscription_namespace_project_label_path(@project.namespace, @project, label)}} .subscription-status{data: {status: label_subscription_status(label)}} - %a.subscribe-icon.btn.action-buttons{data: {toggle: "tooltip", original_title: label_subscription_status(label)}} - %i.fa.fa-rss + %a.subscribe-button.btn.action-buttons{data: {toggle: "tooltip"}} + %span= label_subscription_toggle_button_text(label) - if can? current_user, :admin_label, @project - = link_to edit_namespace_project_label_path(@project.namespace, @project, label), class: 'btn action-buttons', data: {toggle: "tooltip", original_title: "Edit"} do + = link_to edit_namespace_project_label_path(@project.namespace, @project, label), title: "Edit", class: 'btn action-buttons', data: {toggle: "tooltip"} do %i.fa.fa-pencil-square-o - = link_to namespace_project_label_path(@project.namespace, @project, label), class: 'btn action-buttons remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?", toggle: "tooltip", original_title: "Delete"} do + = link_to namespace_project_label_path(@project.namespace, @project, label), title: "Delete", class: 'btn action-buttons remove-row', method: :delete, remote: true, data: {confirm: "Remove this label? Are you sure?", toggle: "tooltip"} do %i.fa.fa-trash-o - if current_user diff --git a/features/steps/project/issues/labels.rb b/features/steps/project/issues/labels.rb index 2ab8956867b..0ca2d6257c3 100644 --- a/features/steps/project/issues/labels.rb +++ b/features/steps/project/issues/labels.rb @@ -15,7 +15,7 @@ class Spinach::Features::ProjectIssuesLabels < Spinach::FeatureSteps step 'I delete all labels' do page.within '.labels' do - page.all('.btn-remove').each do |remove| + page.all('.remove-row').each do |remove| remove.click sleep 0.05 end |
