Skip to content

Commit

Permalink
Merge pull request #29 from ThemeFuse/gutenberg
Browse files Browse the repository at this point in the history
Wordpress 5
  • Loading branch information
ViorelEremia authored Dec 12, 2018
2 parents 3b2db78 + 715d30e commit 2261bb0
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions includes/option-types/builder/static/js/initialize-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,25 @@ window.fwExtBuilderInitialize = (function ($) {
increment: 0,
$adminBar: $('#wpadminbar'),
getAdminBarHeight: function() {
var height = 0;

if (this.$adminBar.length && this.$adminBar.css('position') === 'fixed') {
return this.$adminBar.height();
} else {
return 0;
height = this.$adminBar.height();
}

var gutenbergContainer = $( '#editor.block-editor__container' );

if ( gutenbergContainer.length > 0 ) {
height += gutenbergContainer.find( '.edit-post-header' ).outerHeight() + gutenbergContainer.find( '.components-notice-list' ).height();
}

return height;
},
fix: function($header, $builder, $scrollParent){
var topSpace = this.getAdminBarHeight(),
scrollParentHeight = $scrollParent.height(),
scrollParentScrollTop = $scrollParent.scrollTop(),
scrollParentOffset = $scrollParent.offset(),
scrollParentScrollTop = $( document ).scrollTop(),
scrollParentOffset = $( document ).offset(),
builderHeight = $builder.get(0).clientHeight,
builderOffsetTop = $builder.offset().top,
headerHeight = $header.get(0).clientHeight;
Expand Down Expand Up @@ -581,5 +589,4 @@ window.fwExtBuilderInitialize = (function ($) {

$options.addClass('initialized');
}
})(jQuery);

})(jQuery);

0 comments on commit 2261bb0

Please sign in to comment.