From 46675c06c526bfa9c6b5b43a645d7b0fd4608541 Mon Sep 17 00:00:00 2001 From: Tim Zallmann Date: Tue, 27 Jun 2017 07:44:39 +0200 Subject: Optimisation of the Hide action Fixed some bootlint problems with the buttons --- app/assets/javascripts/label_manager.js | 5 ++--- app/views/shared/_label.html.haml | 2 +- app/views/shared/_label_row.html.haml | 4 ++-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/label_manager.js b/app/assets/javascripts/label_manager.js index 599b6b9383b..d8814802d9e 100644 --- a/app/assets/javascripts/label_manager.js +++ b/app/assets/javascripts/label_manager.js @@ -21,7 +21,7 @@ } bindEvents() { - this.prioritizedLabels.find('.btn-action').on('click', this, this.onButtonActionClick); + this.prioritizedLabels.find('.btn-action').on('mousedown', this, this.onButtonActionClick); return this.togglePriorityButton.on('click', this, this.onTogglePriorityClick); } @@ -39,8 +39,7 @@ onButtonActionClick(e) { e.stopPropagation(); - const $btn = $(e.currentTarget); - $btn.tooltip('hide'); + $(e.currentTarget).tooltip('hide'); } toggleEmptyState($label, $btn, action) { diff --git a/app/views/shared/_label.html.haml b/app/views/shared/_label.html.haml index c185e9b73ee..3f48dbca18a 100644 --- a/app/views/shared/_label.html.haml +++ b/app/views/shared/_label.html.haml @@ -6,7 +6,7 @@ = render "shared/label_row", label: label .visible-xs.visible-sm-inline-block.visible-md-inline-block.dropdown - %button.btn.btn-default.label-options-toggle{ data: { toggle: "dropdown" } } + %button.btn.btn-default.label-options-toggle{ type: 'button', data: { toggle: "dropdown" } } Options = icon('caret-down') .dropdown-menu.dropdown-menu-align-right diff --git a/app/views/shared/_label_row.html.haml b/app/views/shared/_label_row.html.haml index d28f9421ecf..7b599dff0e3 100644 --- a/app/views/shared/_label_row.html.haml +++ b/app/views/shared/_label_row.html.haml @@ -4,9 +4,9 @@ = icon('bars') .js-toggle-priority.toggle-priority{ data: { url: remove_priority_namespace_project_label_path(@project.namespace, @project, label), dom_id: dom_id(label), type: label.type } } - %button.add-priority.btn.has-tooltip{ title: 'Prioritize', :'data-placement' => 'top' } + %button.add-priority.btn.has-tooltip{ title: 'Prioritize', type: 'button', :'data-placement' => 'top' } = icon('star-o') - %button.remove-priority.btn.has-tooltip{ title: 'Remove priority', :'data-placement' => 'top' } + %button.remove-priority.btn.has-tooltip{ title: 'Remove priority', type: 'button', :'data-placement' => 'top' } = icon('star') %span.label-name = link_to_label(label, subject: @project, tooltip: false) -- cgit v1.2.1