You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by er...@apache.org on 2013/03/26 03:41:20 UTC

svn commit: r1460956 - in /rave/trunk/rave-portal-resources/src/main/webapp/static/script: core/rave_opensocial.js portal/rave_ui.js

Author: erinnp
Date: Tue Mar 26 02:41:20 2013
New Revision: 1460956

URL: http://svn.apache.org/r1460956
Log:
Open EE now respects preferred height / width. Gadget maximize tries to open in canvas view.


Modified:
    rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js
    rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js

Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js?rev=1460956&r1=1460955&r2=1460956&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/core/rave_opensocial.js Tue Mar 26 02:41:20 2013
@@ -58,7 +58,7 @@ rave.registerProvider(
         }
 
         /*
-        TODO: these rely on a gadget's view implementing a method
+         TODO: these rely on a gadget's view implementing a method
          */
         function setTitle(args) {
             var widget = args.gs._widget;
@@ -67,12 +67,14 @@ rave.registerProvider(
                 widget._view.setTitle(title);
             }
         }
+
         function hideWidget(args, viewName, opt_params, opt_ownerId) {
             var widget = args.gs._widget;
             if (widget._view && widget._view.collapse) {
                 widget._view.collapse();
             }
         }
+
         function showWidget(args, viewName, opt_params, opt_ownerId) {
             var widget = args.gs._widget;
             if (widget._view && widget._view.expand) {
@@ -111,8 +113,8 @@ rave.registerProvider(
                             "securityToken": data.securityToken,
                             "metadata": opt_gadgetInfo
                         },
-                        height = data.metadata ? data.metadata.height : 500,
-                        width = data.metadata ? data.metadata.width : 525;
+                        height = gadget.metadata.modulePrefs.height || 500,
+                        width = gadget.metadata.modulePrefs.width || 525;
 
                     preloadMetadata(gadget);
 

Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js?rev=1460956&r1=1460955&r2=1460956&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js Tue Mar 26 02:41:20 2013
@@ -261,7 +261,7 @@ _.extend(rave.ui, (function () {
                 };
                 $('.canvas-overlay').css(overlayStyleMap);
 
-                widget.render(widget._el, 'canvas');
+                widget.render(widget._el, {view: 'canvas'});
 
                 function openFullScreenOverlay(widgetId) {
                     addCanvasOverlay($("#pageContent"));
@@ -810,8 +810,17 @@ _.extend(rave.ui, (function () {
             var $site = $(target.contentSelector, $container);
 
             rave.registerView(target.name, {
-                render: function () {
+                render: function (prefs) {
+                    var height = (prefs && prefs.preferredHeight);
+                    var width = (prefs && prefs.preferredWidth);
+                    if (height) {
+                        $container.height(height);
+                    }
+                    if (width) {
+                        $container.width(width);
+                    }
                     $("#pageContent").prepend($container);
+
                     if (_.isFunction(target.initialize)) {
                         target.initialize($container)
                     }