0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Merge pull request #3830 from wjake/issue-3813

Fix editor markdown tab
This commit is contained in:
Hannah Wolfe 2014-08-21 20:09:18 +01:00
commit 62eed88d3b
3 changed files with 11 additions and 16 deletions

View file

@ -277,6 +277,13 @@ var EditorControllerMixin = Ember.Mixin.create(MarkerManager, {
}
}
editor.replaceSelection(result_src);
},
// Make sure editor starts with markdown shown
isPreview: false,
togglePreview: function (preview) {
this.set('isPreview', preview);
}
}
});

View file

@ -10,8 +10,8 @@
</section>
</header>
<section class="entry-markdown active">
<header class="floatingheader">
<section {{bind-attr class=":entry-markdown isPreview::active"}}>
<header {{action "togglePreview" false}} class="floatingheader">
<small>Markdown</small>
<a class="markdown-help" href="" {{action "openModal" "markdown"}}><span class="hidden">What is Markdown?</span></a>
</header>
@ -20,8 +20,8 @@
</section>
</section>
<section class="entry-preview">
<header class="floatingheader" id="entry-preview-header">
<section {{bind-attr class=":entry-preview isPreview:active"}}>
<header {{action "togglePreview" true}} class="floatingheader">
<small>Preview <span class="entry-word-count js-entry-word-count">{{gh-count-words scratch}}</span></small>
</header>
<section class="entry-preview-content">

View file

@ -28,18 +28,6 @@ init = function init() {
if (device.mobile() || (device.tablet() && device.ios())) {
$('body').addClass('touch-editor');
// make editor tabs touch-to-toggle in portrait mode
$('#entry-markdown-header').on('tap', function () {
$('.entry-markdown').addClass('active');
$('.entry-preview').removeClass('active');
});
$('#entry-preview-header').on('tap', function () {
$('.entry-markdown').removeClass('active');
$('.entry-preview').addClass('active');
});
Ember.touchEditor = true;
//initialize FastClick to remove touch delays
Ember.run.scheduleOnce('afterRender', null, function () {