mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Merge pull request #3656 from rwjblue/activate-specific-tab-not-toggle
Activate specific tab that is tapped/clicked.
This commit is contained in:
commit
a647e38e5e
@ -45,9 +45,14 @@ var Codemirror = Ember.TextArea.extend(MarkerManager, {
|
||||
var initMarkers = _.bind(this.initMarkers, this);
|
||||
|
||||
// Allow tabbing behaviour when viewing on small screen (not mobile)
|
||||
$('.floatingheader').on('click', function () {
|
||||
$('.entry-markdown').toggleClass('active');
|
||||
$('.entry-preview').toggleClass('active');
|
||||
$('#entry-markdown-header').on('click', function () {
|
||||
$('.entry-markdown').addClass('active');
|
||||
$('.entry-preview').removeClass('active');
|
||||
});
|
||||
|
||||
$('#entry-preview-header').on('click', function () {
|
||||
$('.entry-markdown').removeClass('active');
|
||||
$('.entry-preview').addClass('active');
|
||||
});
|
||||
|
||||
// replaces CodeMirror with TouchEditor only if we're on mobile
|
||||
|
@ -5,7 +5,7 @@
|
||||
</header>
|
||||
|
||||
<section class="entry-markdown active">
|
||||
<header class="floatingheader">
|
||||
<header class="floatingheader" id="entry-markdown-header">
|
||||
<small>Markdown</small>
|
||||
<a class="markdown-help" href="" {{action "openModal" "markdown"}}><span class="hidden">What is Markdown?</span></a>
|
||||
</header>
|
||||
@ -15,7 +15,7 @@
|
||||
</section>
|
||||
|
||||
<section class="entry-preview">
|
||||
<header class="floatingheader">
|
||||
<header class="floatingheader" id="entry-preview-header">
|
||||
<small>Preview <span class="entry-word-count js-entry-word-count">{{gh-count-words scratch}}</span></small>
|
||||
</header>
|
||||
<section class="entry-preview-content">
|
||||
|
@ -29,11 +29,17 @@ init = function init() {
|
||||
$('body').addClass('touch-editor');
|
||||
|
||||
// make editor tabs touch-to-toggle in portrait mode
|
||||
$('.floatingheader').on('tap', function () {
|
||||
$('.entry-markdown').toggleClass('active');
|
||||
$('.entry-preview').toggleClass('active');
|
||||
$('#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 () {
|
||||
|
Loading…
Reference in New Issue
Block a user