Ariel Weinberger pushed to branch master at cms-community / 
hippo-addon-channel-manager


Commits:
ea7914d9 by Ariel Weinberger at 2017-08-10T12:12:59+02:00
CHANNELMGR-1424 Fix a bug where content was not scrollable after resizing the 
right panel.

- Fixed Sasslint warning (caused by a past commit)

- - - - -


2 changed files:

- 
frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/resizeHandle/resizeHandle.controller.js
- frontend-ng/src/styles/_mask.scss


Changes:

=====================================
frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/resizeHandle/resizeHandle.controller.js
=====================================
--- 
a/frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/resizeHandle/resizeHandle.controller.js
+++ 
b/frontend-ng/src/angularjs/channel/sidePanels/rightSidePanel/resizeHandle/resizeHandle.controller.js
@@ -15,12 +15,15 @@
  */
 
 class resizeHandleController {
-  constructor($element, $document) {
+  constructor($element, $document, $scope) {
     'ngInject';
 
     this.$document = $document;
+    this.$scope = $scope;
     this.handle = $element;
     this.maxWidth = $('body').width() / 2;
+    this.hippoOverlay = {};
+    this.hippoOverlayTransitionTime = this.hippoOverlayTransitionTime;
   }
 
   $onInit() {
@@ -30,12 +33,15 @@ class resizeHandleController {
   _registerEvents(manipulatedElement) {
     this.handle.mousedown((mouseDownEvent) => {
       let newWidth;
-      const hippoIframe = $('hippo-iframe').find('iframe');
-      hippoIframe.css('pointer-events', 'none');
       const initialWidth = manipulatedElement.width();
       const initialX = mouseDownEvent.pageX;
+      const hippoIframe = $('hippo-iframe').find('iframe');
+      hippoIframe.css('pointer-events', 'none');
       manipulatedElement.addClass('in-resize');
 
+      this.hippoOverlay = hippoIframe.contents().find('.hippo-overlay');
+      this._hideHippoOverlay();
+
       this.$document.mousemove((moveEvent) => {
         const diff = initialX - moveEvent.pageX;
         newWidth = initialWidth + diff;
@@ -45,18 +51,34 @@ class resizeHandleController {
 
         if (manipulatedElement.width() >= 440 && manipulatedElement.width() <= 
this.maxWidth) {
           manipulatedElement.css('width', newWidth);
-          manipulatedElement.css('max-width', newWidth);
-          this.onResize({ newWidth });
+          // manipulatedElement.css('max-width', newWidth);
+          // this.onResize({ newWidth });
         }
       });
 
       this.$document.mouseup(() => {
-        this.$document.unbind('mousemove');
-        hippoIframe.css('pointer-events', 'auto');
+        hippoIframe.css('pointer-events', '');
+        this._showHippoOverlay();
         manipulatedElement.removeClass('in-resize');
+        this.$document.unbind('mousemove');
+        this.$document.unbind('mouseup');
       });
     });
   }
+
+  _hideHippoOverlay() {
+    this.hippoOverlay.animate({
+      opacity: '0',
+    }, this.hippoOverlayTransitionTime);
+    setTimeout(() => this.hippoOverlay.css('display', ''), 
this.hippoOverlayTransitionTime);
+  }
+
+  _showHippoOverlay() {
+    this.hippoOverlay.css('display', '');
+    this.hippoOverlay.animate({
+      opacity: '1',
+    }, this.hippoOverlayTransitionTime);
+  }
 }
 
 export default resizeHandleController;


=====================================
frontend-ng/src/styles/_mask.scss
=====================================
--- a/frontend-ng/src/styles/_mask.scss
+++ b/frontend-ng/src/styles/_mask.scss
@@ -15,12 +15,12 @@
 .mask {
   height: 100%;
   left: 0;
+  outline: 0;
   pointer-events: none;
   position: absolute;
   top: 0;
   width: 100%;
   z-index: $z-index-mask;
-  outline: 0;
 
   &.masked {
     cursor: not-allowed;



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/ea7914d919dd765b0f1a8ba8d98a10438cdac247

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/commit/ea7914d919dd765b0f1a8ba8d98a10438cdac247
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to