Mark Lenser pushed to branch feature/visual-editing-psp1-CHANNELMGR-843 at 
cms-community / hippo-addon-channel-manager


Commits:
8f30e8df by Mark at 2016-10-18T16:31:02+02:00
CHANNELMGR-843: still set viewport width

- - - - -
9f63c5b0 by Mark at 2016-10-18T16:33:21+02:00
CHANNELMGR-843: set min-width on desktop and fix test to account for that

- - - - -


3 changed files:

- frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
- 
frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.spec.js
- frontend-ng/src/angularjs/channel/viewports/viewportToggle.controller.js


Changes:

=====================================
frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
=====================================
--- 
a/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
+++ 
b/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.js
@@ -134,7 +134,8 @@ export class OverlaySyncService {
     this.$iframe.css('min-width', '0');
 
     if (this.viewPortWidth === 0) {
-      // Desktop mode - no width constraints
+      // Desktop mode
+      this.$iframe.css('min-width', '1280px');
       this.$sheet.css('max-width', 'none');
       this.$iframe.width('');
       this.$overlay.width('');


=====================================
frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.spec.js
=====================================
--- 
a/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.spec.js
+++ 
b/frontend-ng/src/angularjs/channel/hippoIframe/overlay/overlaySync.service.spec.js
@@ -150,7 +150,7 @@ describe('OverlaySyncService', () => {
         'max-width': 'none',
       });
       expect($iframe).toHaveCss({
-        'min-width': '0px',
+        'min-width': '1280px',
       });
 
       expect($iframe.height()).toEqual(600);


=====================================
frontend-ng/src/angularjs/channel/viewports/viewportToggle.controller.js
=====================================
--- a/frontend-ng/src/angularjs/channel/viewports/viewportToggle.controller.js
+++ b/frontend-ng/src/angularjs/channel/viewports/viewportToggle.controller.js
@@ -15,10 +15,11 @@
  */
 
 export class ViewportToggleCtrl {
-  constructor($translate) {
+  constructor($translate, OverlaySyncService) {
     'ngInject';
 
     this.$translate = $translate;
+    this.OverlaySyncService = OverlaySyncService;
 
     this.viewPorts = [
       {
@@ -43,9 +44,15 @@ export class ViewportToggleCtrl {
 
   activate() {
     this.selectedViewPort = this.viewPorts[0];
+    this.viewPortChanged();
   }
 
   getDisplayName(viewport) {
     return this.$translate.instant(`VIEWPORT_${viewport.id}`);
   }
+
+  viewPortChanged() {
+    this.OverlaySyncService.setViewPortWidth(this.selectedViewPort.width);
+    this.OverlaySyncService.syncIframe();
+  }
 }



View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-addon-channel-manager/compare/6ed9da450fa3b81329f44370369d02dbacb3fdd1...9f63c5b0f94bc13b485005994eb6a9bb61a63078
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to