Newer
Older
dmpopidor / lib / assets / javascripts / views / shared / accessible_submit_button.js
@Jose Lloret Jose Lloret on 22 Aug 2017 446 bytes Resolve merge conflicts. DMPRoadmap/roadmap#587
$(document).ready(function(){
    // Allow the 'button disabled' tooltip to appear if the button is NOT clickable
    $("#<%= id %>").on('click focus', function(e){
      if($(this).attr('aria-disabled') == 'true'){
        e.preventDefault();
        toggleFormElementError(this, "<%= tooltip %>");
      }else{
        toggleFormElementError(this, '');
      }
    }).on('blur', function(){
        toggleFormElementError(this, '');
    });
});