diff --git a/client/src/legacy/CMSMain.AddForm.js b/client/src/legacy/CMSMain.AddForm.js index 6f7c6466..f3e48020 100644 --- a/client/src/legacy/CMSMain.AddForm.js +++ b/client/src/legacy/CMSMain.AddForm.js @@ -137,10 +137,11 @@ $.entwine('ss', function($){ selectedEl.siblings().setSelected(false); // Disable the "Create" button if none of the pagetypes are available - var buttonState = this.find('#Form_AddForm_PageType div.radio:not(.disabled)').length - ? 'enable' - : 'disable'; - this.find('button[name=action_doAdd]').button(buttonState); + if(this.find('#Form_AddForm_PageType div.radio:not(.disabled)').length) { + this.find('button[name=action_doAdd]').removeAttr('disabled'); + } else { + this.find('button[name=action_doAdd]').addAttr('disabled'); + } this.find('.message-restricted')[allAllowed ? 'hide' : 'show'](); } diff --git a/client/src/legacy/CMSMain.EditForm.js b/client/src/legacy/CMSMain.EditForm.js index dc9c1c1e..586e323b 100644 --- a/client/src/legacy/CMSMain.EditForm.js +++ b/client/src/legacy/CMSMain.EditForm.js @@ -379,15 +379,15 @@ $.entwine('ss', function($){ */ $('.cms-edit-form.changed').entwine({ onmatch: function(e) { - this.find('button[name=action_save]').button('option', 'showingAlternate', true); - this.find('button[name=action_publish]').button('option', 'showingAlternate', true); + this.find('button[name=action_save]').attr('data-showingAlternate', true); + this.find('button[name=action_publish]').attr('data-showingAlternate', true); this._super(e); }, onunmatch: function(e) { var saveButton = this.find('button[name=action_save]'); - if(saveButton.data('button')) saveButton.button('option', 'showingAlternate', false); + if(saveButton.data('button')) saveButton.attr('data-showingAlternate', false); var publishButton = this.find('button[name=action_publish]'); - if(publishButton.data('button')) publishButton.button('option', 'showingAlternate', false); + if(publishButton.data('button')) publishButton.attr('data-showingAlternate', false); this._super(e); } }); @@ -397,11 +397,13 @@ $.entwine('ss', function($){ * Bind to ssui.button event to trigger stylistic changes. */ onbuttonafterrefreshalternate: function() { - if (this.button('option', 'showingAlternate')) { - this.addClass('ss-ui-action-constructive'); + if (this.data('showingAlternate')) { + this.addClass('btn-primary'); + this.removeClass('btn-secondary'); } else { - this.removeClass('ss-ui-action-constructive'); + this.removeClass('btn-primary'); + this.addClass('btn-secondary'); } } }); @@ -411,11 +413,13 @@ $.entwine('ss', function($){ * Bind to ssui.button event to trigger stylistic changes. */ onbuttonafterrefreshalternate: function() { - if (this.button('option', 'showingAlternate')) { - this.addClass('ss-ui-action-constructive'); + if (this.data('showingAlternate')) { + this.addClass('btn-primary'); + this.removeClass('btn-secondary'); } else { - this.removeClass('ss-ui-action-constructive'); + this.removeClass('btn-primary'); + this.addClass('btn-secondary'); } } }); diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php index e19dbac4..586d0125 100644 --- a/code/Controllers/CMSMain.php +++ b/code/Controllers/CMSMain.php @@ -450,8 +450,9 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr // Create the Search and Reset action $actions = new FieldList( FormAction::create('doSearch', _t('CMSMain_left_ss.APPLY_FILTER', 'Search')) - ->addExtraClass('ss-ui-action-constructive'), + ->addExtraClass('btn btn-primary'), ResetFormAction::create('clear', _t('CMSMain_left_ss.CLEAR_FILTER', 'Clear')) + ->addExtraClass('btn btn-secondary') ); // Use +
<%-- Change to data-pjax-target="Content-PageList" to enable in-edit listview --%>
- <% _t('CMSMain.AddNewButton', 'Add new') %> + <% _t('CMSMain.AddNewButton', 'Add new') %> <% if $View == 'Tree' %> - <% end_if %>