Permalink
Browse files

API Move state to enwtine properties, provide API for preview.

Also the preview state is now kept between panel loads. We also use a
redraw function to update appearance based on the state.
  • Loading branch information...
1 parent 9312c70 commit 8f5acd70b3ce44b8ab1724bbb027a62be7e7ff9e @mateusz mateusz committed with chillu Nov 29, 2012
@@ -1044,7 +1044,7 @@ public function getEditForm($id = null, $fields = null) {
$fields->push(new HiddenField('ParentID'));
}
- // Added in-line to the form, but plucked into different view by LeftAndMain.Preview.js upon load
+ // Added in-line to the form, but plucked into different view by frontend scripts.
if(in_array('CMSPreviewable', class_implements($record))) {
$navField = new LiteralField('SilverStripeNavigator', $this->getSilverStripeNavigator());
$navField->setAllowHTML(true);
@@ -94,14 +94,6 @@
$('.cms-container').clearCurrentTabState(); // clear state to avoid override later on
firstTabWithErrors.closest('.tabset').tabs('select', firstTabWithErrors.attr('id'));
}
-
- // Move navigator to preview if one is available.
- // If not, just leave the links in the form.
- var previewEl = $('.cms-preview');
- if(previewEl.length) {
- // TODO Relies on DOM element order (the second .cms-navigator is the "old" one)
- previewEl.find('.cms-preview-controls').html(this.find('.cms-navigator').detach());
- }
this._super();
},
Oops, something went wrong.

0 comments on commit 8f5acd7

Please sign in to comment.