Improve compatibility with RainLab.Pages
This commit is contained in:
parent
a4f5e1b96e
commit
80b5c41825
|
|
@ -281,12 +281,6 @@
|
|||
CmsPage.prototype.onAjaxSuccess = function(ev, context, data) {
|
||||
var element = ev.target
|
||||
|
||||
// Reload the form if the server has requested it
|
||||
if (data.forceReload) {
|
||||
this.reloadForm(element)
|
||||
return;
|
||||
}
|
||||
|
||||
// Update the visibilities of the commit & reset buttons
|
||||
$('[data-control=commit-button]', element).toggleClass('hide', !data.canCommit)
|
||||
$('[data-control=reset-button]', element).toggleClass('hide', !data.canReset)
|
||||
|
|
@ -325,6 +319,11 @@
|
|||
if (context.handler == 'onSave' && (!data['X_OCTOBER_ERROR_FIELDS'] && !data['X_OCTOBER_ERROR_MESSAGE'])) {
|
||||
$(element).trigger('unchange.oc.changeMonitor')
|
||||
}
|
||||
|
||||
// Reload the form if the server has requested it
|
||||
if (data.forceReload) {
|
||||
this.reloadForm(element)
|
||||
}
|
||||
}
|
||||
|
||||
CmsPage.prototype.onAjaxError = function(ev, context, message, data, jqXHR) {
|
||||
|
|
|
|||
|
|
@ -421,7 +421,6 @@ class Index extends Controller
|
|||
{
|
||||
$this->validateRequestTheme();
|
||||
$type = Request::input('templateType');
|
||||
|
||||
$template = $this->loadTemplate($type, trim(Request::input('templatePath')));
|
||||
|
||||
if ($this->canResetTemplate($template)) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
<button
|
||||
type="button"
|
||||
class="btn btn-danger oc-icon-download <?php if (!$canCommit): ?>hide<?php endif ?>"
|
||||
data-request="onCommit"
|
||||
data-request-confirm="<?= e(trans('cms::lang.editor.commit_confirm')) ?>"
|
||||
data-load-indicator="<?= e(trans('cms::lang.editor.committing')) ?>"
|
||||
data-control="commit-button">
|
||||
<?= e(trans('cms::lang.editor.commit')) ?>
|
||||
</button>
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
<button
|
||||
type="button"
|
||||
class="btn btn-danger oc-icon-bomb <?php if (!$canReset): ?>hide<?php endif ?>"
|
||||
data-request="onReset"
|
||||
data-request-confirm="<?= e(trans('cms::lang.editor.reset_confirm')) ?>"
|
||||
data-load-indicator="<?= e(trans('cms::lang.editor.resetting')) ?>"
|
||||
data-control="reset-button">
|
||||
<?= e(trans('cms::lang.editor.reset')) ?>
|
||||
</button>
|
||||
|
|
@ -1,22 +1,6 @@
|
|||
<button
|
||||
type="button"
|
||||
class="btn btn-danger oc-icon-download <?php if (!$canCommit): ?>hide<?php endif ?>"
|
||||
data-request="onCommit"
|
||||
data-request-confirm="<?= e(trans('cms::lang.editor.commit_confirm')) ?>"
|
||||
data-load-indicator="<?= e(trans('cms::lang.editor.committing')) ?>"
|
||||
data-control="commit-button">
|
||||
<?= e(trans('cms::lang.editor.commit')) ?>
|
||||
</button>
|
||||
<?= $this->makePartial('button_commit'); ?>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-danger oc-icon-bomb <?php if (!$canReset): ?>hide<?php endif ?>"
|
||||
data-request="onReset"
|
||||
data-request-confirm="<?= e(trans('cms::lang.editor.reset_confirm')) ?>"
|
||||
data-load-indicator="<?= e(trans('cms::lang.editor.resetting')) ?>"
|
||||
data-control="reset-button">
|
||||
<?= e(trans('cms::lang.editor.reset')) ?>
|
||||
</button>
|
||||
<?= $this->makePartial('button_reset'); ?>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
|
|
|
|||
Loading…
Reference in New Issue