Created
May 29, 2018 13:38
-
-
Save vmcilwain/1d0a4c0187fc475583432afdba9ac473 to your computer and use it in GitHub Desktop.
Disable links with a data attribute named action that ends with `_export_action`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Disable links with a class that ends with `_export_action` | |
# Example data-action='event_export_action' or data-action='room_export_action' | |
$(document).on 'click', "a[data-action$='_export_action']", -> | |
$this = $(this) | |
$label = $this.text | |
$this.attr('disabled', true).html('Working...') | |
# not necessary if page refreshes but just in case using with ajax | |
$this.attr('disabled', false).html($label) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment