Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW display controls in a consistent manner #27

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ before_script:

# Install composer
- composer validate
- if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql 2.0.x-dev; fi
- if [[ $DB == PGSQL ]]; then composer require --prefer-dist --no-update silverstripe/postgresql 2.1.x-dev; fi
- composer require --no-update silverstripe/recipe-testing:^1 silverstripe/recipe-cms 1.2.x-dev
- composer install --prefer-source

Expand Down
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions client/src/legacy/HistoryViewer/HistoryViewerEntwine.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,34 @@ jQuery.entwine('ss', ($) => {
this._super(e);
}
});

// Work arounds for the CMS not rendering entirely in react yet
// When loading from e.g. GridFieldDetailForm both button sets
// save/publish _and_ the "revert" button were rendered.
// Enabling this functionality requires a developer to add
// $tab->addExtraClass('tab--history-viewer')
// to the tab the HistoryViewerField is rendered into.
// c.f. dnadesign/silverstripe-elemental BaseElement::getCMSFields
$('.tab.tab--history-viewer[aria-hidden=false]').entwine({
onmatch() {
$('.toolbar--south.cms-content-actions').hide();
},
onunmatch() {
$('.toolbar--south.cms-content-actions').show();
}
});
$('.tab.tab--history-viewer .history-viewer__version-detail').entwine({
onmatch() {
this
.parent()
.css('padding-bottom', '3rem')
.next('.toolbar--south')
.css({
position: 'absolute',
bottom: 0,
left: 0,
right: 0
});
}
});
});