Skip to content

Commit

Permalink
Live preview
Browse files Browse the repository at this point in the history
- Added live preview for heading and date content items
  • Loading branch information
deanblackborough committed Feb 18, 2017
1 parent 0384740 commit c5a21c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ protected function previewData()

$this->contentData();

$this->preview_data = array();
$this->preview_data = array(
'heading' => $this->content_data['heading'],
'date' => date($this->content_data['format'], strtotime($this->content_data['date']))
);

$this->preview_data_fetched = true;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
<?php /** @var $this Dlayer_View_Codehinting */?>

<?php if ($this->content_id !== null) { ?>
<script>
previewContentManager.headingText('#params-heading', '#params-date', '.content[data-content-id="' + <?php echo $this->escape($this->content_id); ?> + '"]', <?php echo $this->json($this->data['preview']['heading']); ?>, <?php echo $this->json($this->data['preview']['date']); ?>, false);
previewContentManager.headingType('#params-type', '.content[data-content-id="' + <?php echo $this->escape($this->content_id); ?> + '"]');
</script>
<?php } ?>

<div class="col-md-12 col-sm-12">
<p class="dev-note bg-danger unsaved">Data has been modified!</p>
<p class="dev-note bg-danger unsaved">Data has been modified!</p>
</div>

<div class="col-md-12 col-sm-12">
<?php
<?php
if($this->data != FALSE) {
echo $this->data['form'];
}
Expand Down

0 comments on commit c5a21c3

Please sign in to comment.