From 68c4affb02058a4cf61be881d074e08fca869055 Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 18 Dec 2013 22:22:34 +0100 Subject: [PATCH] better disabled button --- app/assets/javascripts/application.js | 5 +++++ app/views/orders/index.html.haml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 0517c896..e9eeffae 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -107,6 +107,11 @@ $(function() { return false; }); + // Disable action of disabled buttons + $(document).on('click', 'a.disabled', function() { + return false; + }); + // Show and hide loader on ajax callbacks $('*[data-remote]').bind('ajax:beforeSend', function() { $('#loader').show(); diff --git a/app/views/orders/index.html.haml b/app/views/orders/index.html.haml index c288de84..c705384a 100644 --- a/app/views/orders/index.html.haml +++ b/app/views/orders/index.html.haml @@ -57,7 +57,7 @@ = link_to t('.action_receive'), receive_order_path(order), class: 'btn btn-small btn-success' %td - = link_to t('ui.edit'), '#', class: 'btn btn-small disabled' + = link_to t('ui.edit'), '#', class: 'btn btn-small disabled', tabindex: -1 = link_to t('ui.show'), order, class: 'btn btn-small' = link_to t('ui.delete'), order, confirm: t('.confirm_delete'), method: :delete, class: 'btn btn-small btn-danger'