From ecae8d0dcca3547c24ebe71ef936d66fe805e657 Mon Sep 17 00:00:00 2001 From: ramanItul-dev <161682965+ramanItul-dev@users.noreply.github.com> Date: Thu, 17 Oct 2024 10:18:38 +0530 Subject: [PATCH] Update itulFramework.js changes in click.ajaxLink , adding this //DISABLE THE BUTTON TO PREVENT MULTIPLE CLICKS --- itulFramework.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/itulFramework.js b/itulFramework.js index 05de85f..216eb51 100644 --- a/itulFramework.js +++ b/itulFramework.js @@ -706,12 +706,16 @@ function init_fill_height(trigger = true){ e.preventDefault(); e.stopPropagation(); + //DISABLE THE BUTTON TO PREVENT MULTIPLE CLICKS + var ele = $(this); + ele.prop('disabled', true); // Disable the button + //SHOW THE SPINNER spinner(); //PARSE THE ATTRIBUTES var callback_name = $(this).attr('callback'); - var ele = $(this); + var target = $(this).attr('data-element') !== undefined ? $($(this).attr('data-element')) : false; var url = $(this).attr('data-url') !== undefined ? $(this).attr('data-url') : $(this).attr('href'); var callback_type = $(this).attr('data-callback_type') !== undefined ? $(this).attr('data-callback_type') : 'html'; @@ -762,7 +766,13 @@ function init_fill_height(trigger = true){ else{ spinner('hide'); } + + } + }).done(function(){ + spinner('hide'); + //RE-ENABLE THE BUTTON AFTER SUCCESS + ele.prop('disabled', false); }); } else{