diff --git a/code/GridFieldBulkImageUpload_Request.php b/code/GridFieldBulkImageUpload_Request.php index fc84b6e..d8d9f70 100644 --- a/code/GridFieldBulkImageUpload_Request.php +++ b/code/GridFieldBulkImageUpload_Request.php @@ -196,20 +196,7 @@ class GridFieldBulkImageUpload_Request extends RequestHandler { ->setUseButtonTag(true) //->setDisabled(true) ); - /* - if($crumbs && $crumbs->count()>=2) - { - $actions->push( - FormAction::create('SaveAndFinish', 'Save All & Finish') - ->setAttribute('id', 'bulkImageUploadUpdateFinishBtn') - ->addExtraClass('ss-ui-action-constructive cms-panel-link') - ->setAttribute('data-icon', 'accept') - ->setAttribute('data-url', $this->Link('update')) - ->setAttribute('data-return-url', $one_level_up->Link) - ->setUseButtonTag(true) - ); - } - */ + $actions->push( FormAction::create('Cancel', 'Cancel & Delete All') ->setAttribute('id', 'bulkImageUploadUpdateCancelBtn') diff --git a/javascript/GridFieldBulkImageUpload.js b/javascript/GridFieldBulkImageUpload.js index 9fdc112..35440d3 100644 --- a/javascript/GridFieldBulkImageUpload.js +++ b/javascript/GridFieldBulkImageUpload.js @@ -73,8 +73,6 @@ $(itemStatus).removeClass('updated').addClass('dirty').html('Changed'); if ( $(itemInfo).hasClass('updated') ) $(itemInfo).removeClass('updated'); if ( !$(itemInfo).hasClass('dirty') ) $(itemInfo).addClass('dirty'); - - $('#bulkImageUploadUpdateFinishBtn').addClass('dirty'); $('#bulkImageUploadUpdateBtn').removeClass('ui-state-disabled ssui-button-disabled'); $('#bulkImageUploadUpdateBtn').attr('aria-disabled', 'false'); @@ -143,14 +141,9 @@ $(this).removeClass('hasUpdate'); if ( counter == totalForms ) { - $('#bulkImageUploadUpdateFinishBtn').removeClass('dirty'); $('#bulkImageUploadUpdateBtn').data('completedForms', 0); $('#bulkImageUploadUpdateBtn').removeClass('loading'); $('#bulkImageUploadUpdateBtn').addClass('ui-state-disabled'); - if ( $('#bulkImageUploadUpdateBtn').hasClass('doFinish') ) { - //@TODO find a way to pass this as CMS navigation through AJAX - window.location = $('#bulkImageUploadUpdateFinishBtn').data('return-url'); - } } }); @@ -159,15 +152,6 @@ } }); - $('#bulkImageUploadUpdateFinishBtn').entwine({ - onclick: function(e){ - if ( $(this).hasClass('dirty') ) { - $('#bulkImageUploadUpdateBtn').addClass('doFinish'); - $('#bulkImageUploadUpdateBtn').click(); - } - } - }); - $('.ss-uploadfield-item-editform').entwine({ onmatch: function(e){ $('#bulkImageUploadUpdateCancelBtn').removeClass('ui-state-disabled ssui-button-disabled');