Skip to content

Commit

Permalink
Fixed #1364
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamindavid committed May 19, 2017
1 parent daad0b6 commit b012155
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Craft CMS 3.0 Working Changelog
- Fixed a bug where it was not possible to set the User Photo Volume on Craft Personal and Client editions. ([#1717](https://github.com/craftcms/cms/issues/1717))
- Fixed a bug where changing a named transform’s dimensions would not cause already generated transforms to become invalidated.
- Fixed a bug where omitting weight in transforms would result in an error when trying to use the transform. ([#1713](https://github.com/craftcms/cms/issues/1713))
- Another fix to the Panes’ sidebar which could get a wrong height when scrolling down. ([#1364](https://github.com/craftcms/cms/issues/1364))

## 3.0.0-beta.17 - 2017-05-13

Expand Down
16 changes: 6 additions & 10 deletions src/web/assets/cp/dist/js/Craft.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! Craft 3.0.0 - 2017-05-04 */
/*! Craft 3.0.0 - 2017-05-19 */
(function($){

/** global: Craft */
Expand Down Expand Up @@ -13340,7 +13340,6 @@ Craft.Pane = Garnish.Base.extend(
},

updateSidebarStyles: function() {

var $pageHeader = $('#page-header');

this.updateSidebarStyles._styles = {};
Expand All @@ -13349,16 +13348,14 @@ Craft.Pane = Garnish.Base.extend(
this.updateSidebarStyles._pageHeaderHeight = $pageHeader.outerHeight();
this.updateSidebarStyles._paneOffset = this.$pane.offset().top + (this.$tabsContainer.height() ? this.$tabsContainer.height() : 0) - this.updateSidebarStyles._pageHeaderHeight;
this.updateSidebarStyles._paneHeight = this.$pane.outerHeight() - (this.$tabsContainer.height() ? this.$tabsContainer.height() : 0);

this.updateSidebarStyles._windowHeight = Garnish.$win.height();

// Have we scrolled passed the top of the pane?
if (Garnish.$win.width() > 768 && this.updateSidebarStyles._scrollTop > this.updateSidebarStyles._paneOffset) {
// Set the top position to the difference
this.updateSidebarStyles._styles.position = 'fixed';
this.updateSidebarStyles._styles.top = (24 + this.updateSidebarStyles._pageHeaderHeight) + 'px';
}
else {
} else {
this.updateSidebarStyles._styles.position = 'absolute';

if (Garnish.$win.width() > 768) {
Expand All @@ -13371,14 +13368,13 @@ Craft.Pane = Garnish.Base.extend(

// Now figure out how tall the sidebar can be
this.updateSidebarStyles._styles.maxHeight = Math.min(
(this.updateSidebarStyles._paneHeight - (this.updateSidebarStyles._scrollTop + this.updateSidebarStyles._paneOffset)),
(this.updateSidebarStyles._windowHeight - this.updateSidebarStyles._pageHeaderHeight)
this.updateSidebarStyles._paneHeight - (this.updateSidebarStyles._scrollTop - this.updateSidebarStyles._paneOffset),
this.updateSidebarStyles._windowHeight
);

if (this.updateSidebarStyles._paneHeight > (this.updateSidebarStyles._windowHeight - this.updateSidebarStyles._pageHeaderHeight)) {
if(this.updateSidebarStyles._paneHeight > this.updateSidebarStyles._windowHeight) {
this.updateSidebarStyles._styles.height = this.updateSidebarStyles._styles.maxHeight;
}
else {
} else {
this.updateSidebarStyles._styles.height = this.updateSidebarStyles._paneHeight;
}

Expand Down
18 changes: 9 additions & 9 deletions src/web/assets/cp/dist/js/Craft.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/web/assets/cp/dist/js/Craft.min.js.map

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions src/web/assets/cp/src/js/Pane.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ Craft.Pane = Garnish.Base.extend(
},

updateSidebarStyles: function() {

var $pageHeader = $('#page-header');

this.updateSidebarStyles._styles = {};
Expand All @@ -157,16 +156,14 @@ Craft.Pane = Garnish.Base.extend(
this.updateSidebarStyles._pageHeaderHeight = $pageHeader.outerHeight();
this.updateSidebarStyles._paneOffset = this.$pane.offset().top + (this.$tabsContainer.height() ? this.$tabsContainer.height() : 0) - this.updateSidebarStyles._pageHeaderHeight;
this.updateSidebarStyles._paneHeight = this.$pane.outerHeight() - (this.$tabsContainer.height() ? this.$tabsContainer.height() : 0);

this.updateSidebarStyles._windowHeight = Garnish.$win.height();

// Have we scrolled passed the top of the pane?
if (Garnish.$win.width() > 768 && this.updateSidebarStyles._scrollTop > this.updateSidebarStyles._paneOffset) {
// Set the top position to the difference
this.updateSidebarStyles._styles.position = 'fixed';
this.updateSidebarStyles._styles.top = (24 + this.updateSidebarStyles._pageHeaderHeight) + 'px';
}
else {
} else {
this.updateSidebarStyles._styles.position = 'absolute';

if (Garnish.$win.width() > 768) {
Expand All @@ -179,14 +176,13 @@ Craft.Pane = Garnish.Base.extend(

// Now figure out how tall the sidebar can be
this.updateSidebarStyles._styles.maxHeight = Math.min(
(this.updateSidebarStyles._paneHeight - (this.updateSidebarStyles._scrollTop + this.updateSidebarStyles._paneOffset)),
(this.updateSidebarStyles._windowHeight - this.updateSidebarStyles._pageHeaderHeight)
this.updateSidebarStyles._paneHeight - (this.updateSidebarStyles._scrollTop - this.updateSidebarStyles._paneOffset),
this.updateSidebarStyles._windowHeight
);

if (this.updateSidebarStyles._paneHeight > (this.updateSidebarStyles._windowHeight - this.updateSidebarStyles._pageHeaderHeight)) {
if(this.updateSidebarStyles._paneHeight > this.updateSidebarStyles._windowHeight) {
this.updateSidebarStyles._styles.height = this.updateSidebarStyles._styles.maxHeight;
}
else {
} else {
this.updateSidebarStyles._styles.height = this.updateSidebarStyles._paneHeight;
}

Expand Down

0 comments on commit b012155

Please sign in to comment.