Skip to content

Commit

Permalink
Fixes page deletion for newer platform
Browse files Browse the repository at this point in the history
Fixes #477
  • Loading branch information
daftspunk committed Apr 18, 2021
1 parent 1ca6f68 commit 2427d56
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
14 changes: 13 additions & 1 deletion assets/js/pages-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,18 @@
this.updateContentEditorMode($tabPane, false)
}

PagesPage.prototype.onDeletePageSingle = function(el) {
var $el = $(el);

$el.request('onDelete', {
success: function(data) {
$.oc.pagesPage.closeTabs(data, 'page');
$.oc.pagesPage.updateObjectList('page');
$(this).trigger('close.oc.tab', [{force: true}]);
}
});
}

/*
* Updates the browser title when an object is saved.
*/
Expand All @@ -275,7 +287,7 @@
}
}).always(function(){
$.oc.stripeLoadIndicator.hide()
})
});
}

/*
Expand Down
5 changes: 2 additions & 3 deletions controllers/index/_page_toolbar.htm
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@
<button
type="button"
class="btn btn-default empty oc-icon-trash-o <?php if (!$objectPath): ?>hide<?php endif ?>"
data-request="onDelete"
onclick="$.oc.pagesPage.onDeletePageSingle(this)"
data-request-confirm="<?= e(trans('rainlab.pages::lang.page.delete_confirm_single')) ?>"
data-request-success="$.oc.pagesPage.closeTabs(data, 'page'); $.oc.pagesPage.updateObjectList('page'); $(this).trigger('close.oc.tab', [{force: true}])"
data-control="delete-button">
</button>

<?= $this->makePartial('~/modules/cms/controllers/index/_button_lastmodified.htm'); ?>
</div>
</div>
1 change: 1 addition & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,4 @@
1.3.7: Adds MenuPicker formwidget. Adds future support for v2.0 of October CMS.
1.4.0: Fixes bug when adding menu items in October CMS v2.0.
1.4.1: Fixes support for configuration values.
1.4.3: Fixes page deletion is newer platform builds.

0 comments on commit 2427d56

Please sign in to comment.