mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
7c7b1060f4
issue #2426 - ember markdown component now looks for preview element as a DOM ancestor rather than a descendent
11 lines
No EOL
440 B
JavaScript
11 lines
No EOL
440 B
JavaScript
var Markdown = Ember.Component.extend({
|
|
adjustScrollPosition: function () {
|
|
var scrollWrapper = this.$().closest('.entry-preview-content').get(0),
|
|
// calculate absolute scroll position from percentage
|
|
scrollPixel = scrollWrapper.scrollHeight * this.get('scrollPosition');
|
|
|
|
scrollWrapper.scrollTop = scrollPixel; // adjust scroll position
|
|
}.observes('scrollPosition')
|
|
});
|
|
|
|
export default Markdown; |