diff --git a/core/client/components/gh-codemirror.js b/core/client/components/gh-codemirror.js index 502ff690e5..6ccb474625 100644 --- a/core/client/components/gh-codemirror.js +++ b/core/client/components/gh-codemirror.js @@ -44,17 +44,6 @@ var Codemirror = Ember.TextArea.extend(MarkerManager, { afterRenderEvent: function () { var initMarkers = _.bind(this.initMarkers, this); - // Allow tabbing behaviour when viewing on small screen (not mobile) - $('#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 mobileCodeMirror.createIfMobile(); @@ -88,7 +77,7 @@ var Codemirror = Ember.TextArea.extend(MarkerManager, { codemirror.on('scroll', onScrollHandler); codemirror.on('scroll', Ember.run.bind(Ember.$('.CodeMirror-scroll'), setScrollClassName, { - target: Ember.$('.entry-markdown'), + target: Ember.$('.js-entry-markdown'), offset: 10 })); diff --git a/core/client/components/gh-markdown.js b/core/client/components/gh-markdown.js index 239e186d9c..39d6101c20 100644 --- a/core/client/components/gh-markdown.js +++ b/core/client/components/gh-markdown.js @@ -1,8 +1,6 @@ import uploader from 'ghost/assets/lib/uploader'; var Markdown = Ember.Component.extend({ - classNames: ['rendered-markdown'], - didInsertElement: function () { this.set('scrollWrapper', this.$().closest('.entry-preview-content')); }, diff --git a/core/client/components/gh-modal-dialog.js b/core/client/components/gh-modal-dialog.js index e8533ed181..ee3636bd7e 100644 --- a/core/client/components/gh-modal-dialog.js +++ b/core/client/components/gh-modal-dialog.js @@ -1,8 +1,8 @@ var ModalDialog = Ember.Component.extend({ didInsertElement: function () { - this.$('#modal-container').fadeIn(50); + this.$('.js-modal-container').fadeIn(50); - this.$('.modal-background').show().fadeIn(10, function () { + this.$('.js-modal-background').show().fadeIn(10, function () { $(this).addClass('in'); }); @@ -13,7 +13,7 @@ var ModalDialog = Ember.Component.extend({ this.$('.js-modal').removeClass('in'); - this.$('.modal-background').removeClass('in'); + this.$('.js-modal-background').removeClass('in'); return this._super(); }, @@ -46,7 +46,7 @@ var ModalDialog = Ember.Component.extend({ return classNames.join(' '); }), - + acceptButtonClass: Ember.computed('confirm.accept.buttonClass', function () { return this.get('confirm.accept.buttonClass') ? this.get('confirm.accept.buttonClass') : 'btn btn-green'; }), diff --git a/core/client/controllers/posts.js b/core/client/controllers/posts.js index bf2c8f1d60..e5cd933e13 100644 --- a/core/client/controllers/posts.js +++ b/core/client/controllers/posts.js @@ -71,23 +71,22 @@ var PostsController = Ember.ArrayController.extend(PaginationControllerMixin, { //let the PaginationControllerMixin know what type of model we will be paginating //this is necesariy because we do not have access to the model inside the Controller::init method this._super({'modelType': 'post'}); - }, actions: { resetContentPreview: function () { - $('.content-list').removeAttr('style'); - $('.content-preview').removeAttr('style'); + $('.js-content-list').removeAttr('style'); + $('.js-content-preview').removeAttr('style'); }, showContentPreview: function () { - $('.content-list').animate({right: '100%', left: '-100%', 'margin-right': '15px'}, 300); - $('.content-preview').animate({right: '0', left: '0', 'margin-left': '0'}, 300); + $('.js-content-list').animate({right: '100%', left: '-100%', 'margin-right': '15px'}, 300); + $('.js-content-preview').animate({right: '0', left: '0', 'margin-left': '0'}, 300); }, hideContentPreview: function () { - $('.content-list').animate({right: '0', left: '0', 'margin-right': '0'}, 300); - $('.content-preview').animate({right: '-100%', left: '100%', 'margin-left': '15px'}, 300); + $('.js-content-list').animate({right: '0', left: '0', 'margin-right': '0'}, 300); + $('.js-content-preview').animate({right: '-100%', left: '100%', 'margin-left': '15px'}, 300); }, } }); diff --git a/core/client/mixins/editor-base-view.js b/core/client/mixins/editor-base-view.js index 7d71a492ee..c2858591b7 100644 --- a/core/client/mixins/editor-base-view.js +++ b/core/client/mixins/editor-base-view.js @@ -14,14 +14,14 @@ var EditorViewMixin = Ember.Mixin.create({ // all child views will have rendered when this fires afterRenderEvent: function () { - var $previewViewPort = this.$('.entry-preview-content'); + var $previewViewPort = this.$('.js-entry-preview-content'); // cache these elements for use in other methods this.set('$previewViewPort', $previewViewPort); - this.set('$previewContent', this.$('.rendered-markdown')); + this.set('$previewContent', this.$('.js-rendered-markdown')); $previewViewPort.scroll(Ember.run.bind($previewViewPort, setScrollClassName, { - target: this.$('.entry-preview'), + target: this.$('.js-entry-preview'), offset: 10 })); }, diff --git a/core/client/templates/components/gh-modal-dialog.hbs b/core/client/templates/components/gh-modal-dialog.hbs index bf589aa8b3..cb54fc393c 100644 --- a/core/client/templates/components/gh-modal-dialog.hbs +++ b/core/client/templates/components/gh-modal-dialog.hbs @@ -1,4 +1,4 @@ -