Skip to content

Commit

Permalink
Dev: Abort immediately if no massive action checkbox is checked
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Sep 22, 2016
1 parent a7df63c commit 39a4b01
Showing 1 changed file with 9 additions and 10 deletions.
Expand Up @@ -25,6 +25,13 @@ $(document).on('click', '.listActions a', function ()
var $oCheckedItems = JSON.stringify($oCheckedItems);
var actionType = $that.data('actionType');

if( $oCheckedItems == '[]' ) {
//If no item selected, the error modal "please select first an item" is shown
// TODO: add a variable in the widget to replace "item" by the item type (e.g: survey, question, token, etc.)
$('#error-first-select').modal();
return;
}

// TODO : Switch action (post, session, ajax...)

// For actions without modal, doing a redirection
Expand Down Expand Up @@ -75,6 +82,7 @@ $(document).on('click', '.listActions a', function ()
console.log('js', js);
var func = eval(js);
func();
return;
}

// TODO: switch case "Modal"
Expand Down Expand Up @@ -174,16 +182,7 @@ $(document).on('click', '.listActions a', function ()
});

// open the modal
if( $oCheckedItems !== '[]' )
{
$modal.modal();
}
else
{
//If no item selected, the error modal "please select first an item" is shown
// TODO: add a variable in the widget to replace "item" by the item type (e.g: survey, question, token, etc.)
$('#error-first-select').modal();
}
$modal.modal();
});

/**
Expand Down

0 comments on commit 39a4b01

Please sign in to comment.