Skip to content

Commit

Permalink
Remove setScrollClassName mixin and usage
Browse files Browse the repository at this point in the history
no issue
- removes `setScrollClassName` mixin that was previously used to add a `.scrolling` class to scrollable elements that showed a shadow at the top of boxes when not scrolled to the top
  • Loading branch information
kevinansfield committed Dec 15, 2015
1 parent 7fea696 commit 117ab27
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 72 deletions.
22 changes: 1 addition & 21 deletions core/client/app/components/gh-content-preview-content.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
import Ember from 'ember';
import setScrollClassName from 'ghost/utils/set-scroll-classname';

const {Component, run} = Ember;
const {Component} = Ember;

export default Component.extend({
classNames: ['content-preview-content'],

content: null,

didInsertElement() {
this._super(...arguments);

let el = this.$();

el.on('scroll', run.bind(el, setScrollClassName, {
target: el.closest('.content-preview'),
offset: 10
}));
},

didReceiveAttrs(options) {
this._super(...arguments);

Expand All @@ -30,13 +18,5 @@ export default Component.extend({
el.closest('.content-preview').scrollTop(0);
}
}
},

willDestroyElement() {
this._super(...arguments);

let el = this.$();

el.off('scroll');
}
});
12 changes: 0 additions & 12 deletions core/client/app/components/gh-editor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Ember from 'ember';
import setScrollClassName from 'ghost/utils/set-scroll-classname';

const {Component, computed, run} = Ember;
const {equal} = computed;
Expand Down Expand Up @@ -54,17 +53,6 @@ export default Component.extend({
// cache these elements for use in other methods
this.set('$previewViewPort', $previewViewPort);
this.set('$previewContent', this.$('.js-rendered-markdown'));

$previewViewPort.on('scroll', run.bind($previewViewPort, setScrollClassName, {
target: this.$('.js-entry-preview'),
offset: 10
}));
},

willDestroyElement() {
this._super(...arguments);
// removes scroll handlers from the view
this.get('$previewViewPort').off('scroll');
},

actions: {
Expand Down
18 changes: 1 addition & 17 deletions core/client/app/components/gh-infinite-scroll-box.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,7 @@
import Ember from 'ember';
import InfiniteScrollMixin from 'ghost/mixins/infinite-scroll';
import setScrollClassName from 'ghost/utils/set-scroll-classname';

const {Component, run} = Ember;
const {Component} = Ember;

export default Component.extend(InfiniteScrollMixin, {
didInsertElement() {
let el = this.$();

this._super(...arguments);

el.on('scroll', run.bind(el, setScrollClassName, {
target: el.closest('.content-list'),
offset: 10
}));
},

willDestroyElement() {
this._super(...arguments);
this.$().off('scroll');
}
});
5 changes: 0 additions & 5 deletions core/client/app/mixins/ed-editor-scroll.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import Ember from 'ember';
import setScrollClassName from 'ghost/utils/set-scroll-classname';

const {Mixin, run} = Ember;

Expand Down Expand Up @@ -75,10 +74,6 @@ export default Mixin.create({
$el.on('keypress', run.bind(this, this.adjustScrollPosition));

$el.on('scroll', run.bind(this, this.scrollHandler));
$el.on('scroll', run.bind($el, setScrollClassName, {
target: Ember.$('.js-entry-markdown'),
offset: 10
}));
},

/**
Expand Down
17 changes: 0 additions & 17 deletions core/client/app/utils/set-scroll-classname.js

This file was deleted.

0 comments on commit 117ab27

Please sign in to comment.