Skip to content

Commit

Permalink
Fixed issue #13153: Confirm Popup stays active after deleting a singl…
Browse files Browse the repository at this point in the history
…e token and clicking "yes"
  • Loading branch information
lacrioque committed Jan 16, 2018
1 parent 74ae353 commit 1422d25
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
Expand Up @@ -20,7 +20,7 @@ var onClickListAction = function () {
var $actionUrl = $that.data('url'); // The url of the Survey Controller action to call
var onSuccess = $that.data('on-success');
var $gridid = $(this).closest('div.listActions').data('grid-id');
var $oCheckedItems = $.fn.yiiGridView.getChecked($gridid, $(this).closest('div.listActions').data('pk')); // List of the clicked checkbox
var $oCheckedItems = $gridid.yiiGridView('getChecked', $(this).closest('div.listActions').data('pk')); // List of the clicked checkbox
var $oCheckedItems = JSON.stringify($oCheckedItems);
var actionType = $that.data('actionType');

Expand All @@ -39,7 +39,7 @@ var onClickListAction = function () {
// TODO : Switch case "redirection (with 2 type; post or fill session)"
if(actionType == "redirect")
{
$oCheckedItems = $.fn.yiiGridView.getChecked($gridid, $('.listActions').data('pk')); // So we can join
$oCheckedItems = $gridid.yiiGridView('getChecked', $('.listActions').data('pk')); // So we can join
var newForm = jQuery('<form>', {
'action': $actionUrl,
'target': '_blank',
Expand Down Expand Up @@ -71,7 +71,7 @@ var onClickListAction = function () {

// Set window location href. Used by download files in responses list view.
if (actionType == 'window-location-href') {
var $oCheckedItems = $.fn.yiiGridView.getChecked($gridid, $('.listActions').data('pk')); // So we can join
var $oCheckedItems = $gridid.yiiGridView('getChecked', $('.listActions').data('pk')); // So we can join
window.location.href = $actionUrl + $oCheckedItems.join(',');
return;
}
Expand All @@ -83,7 +83,7 @@ var onClickListAction = function () {
if (actionType == 'custom') {
var js = $that.data('custom-js');
var func = eval(js);
var itemIds = $.fn.yiiGridView.getChecked($gridid, $('.listActions').data('pk'));
var itemIds = $gridid.yiiGridView('getChecked', $('.listActions').data('pk'));
func(itemIds);
return;
}
Expand Down Expand Up @@ -113,7 +113,7 @@ var onClickListAction = function () {

if ($that.data('grid-reload') == "yes")
{
$.fn.yiiGridView.update($gridid); // Update the surveys list
$gridid.yiiGridView('update'); // Update the surveys list
setTimeout(function(){
$(document).trigger("actions-updated");}, 500); // Raise an event if some widgets inside the modals need some refresh (eg: position widget in question list)
}
Expand Down
Expand Up @@ -9,7 +9,7 @@ $(document).on('ready pjax:scriptcomplete', function() {
{
jQuery(document).on("change", '#pageSize', function()
{
$.fn.yiiGridView.update('survey-grid',{ data:{ pageSize: $(this).val() }});
$('#survey-grid').yiiGridView('update',{ data:{ pageSize: $(this).val() }});
});
});
});
15 changes: 6 additions & 9 deletions assets/scripts/admin/tokens.js
Expand Up @@ -227,15 +227,12 @@ $(document).on('ready pjax:scriptcomplete', function(){
url: actionUrl,
method: "GET",
success: function(data){
try{
$.fn.yiiGridView.update('token-grid', {
complete: function(s){
$modal.modal('hide');
} // Update the surveys list
});
} catch(e){
if(e){console.ls.error(e); $modal.modal('hide');}
}

$('#token-grid').yiiGridView('update',{
complete: function(s){
$modal.modal('hide');
} // Update the surveys list
});
}
});
})
Expand Down

0 comments on commit 1422d25

Please sign in to comment.