Skip to content

Commit

Permalink
Fine tuning editor buttons disappearing with fade, and show 'Preview'
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviocopes committed Oct 5, 2015
1 parent ad974da commit ac156ad
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
5 changes: 5 additions & 0 deletions themes/grav/css-compiled/template.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion themes/grav/css-compiled/template.css.map

Large diffs are not rendered by default.

11 changes: 9 additions & 2 deletions themes/grav/js/mdeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
'<li><a data-mdeditor-button="fullscreen"><i class="fa fa-fw fa-expand"></i></a></li>',
'</ul>',
'</div>',
'<p class="grav-mdeditor-preview-text" style="display: none;">Preview</p>',
'</div>',
'<div class="grav-mdeditor-content">',
'<div class="grav-mdeditor-code"></div>',
Expand Down Expand Up @@ -172,9 +173,15 @@
$this.editor.refresh();

if ($this.activetab == 'preview') {
$('.grav-mdeditor-toolbar').hide();
$('.grav-mdeditor-toolbar').fadeOut();
setTimeout(function() {
$('.grav-mdeditor-preview-text').fadeIn();
}, 500);
} else {
$('.grav-mdeditor-toolbar').show();
$('.grav-mdeditor-preview-text').fadeOut();
setTimeout(function() {
$('.grav-mdeditor-toolbar').fadeIn();
}, 500);
}
}
});
Expand Down
8 changes: 8 additions & 0 deletions themes/grav/scss/template/_editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@
border-bottom-right-radius: $form-border-radius;
}

.grav-mdeditor-navbar {
p {
margin-top: 10px;
margin-bottom: 10px;
padding-left: 20px;
}
}

#admin-main {
.grav-mdeditor-preview {
font-family: $font-family-default;
Expand Down

0 comments on commit ac156ad

Please sign in to comment.