You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rave.apache.org by kl...@apache.org on 2012/12/13 22:24:24 UTC
svn commit: r1421545 - in /rave/trunk/rave-portal-resources/src/main/webapp:
WEB-INF/tags/region_widget.tag static/css/rave-css.less
static/script/rave_layout.js
Author: klegacy
Date: Thu Dec 13 21:24:21 2012
New Revision: 1421545
URL: http://svn.apache.org/viewvc?rev=1421545&view=rev
Log:
RAVE-532 Capturing click over iframe to close widgets dropdown menu
Modified:
rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less
rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_layout.js
Modified: rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag?rev=1421545&r1=1421544&r2=1421545&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/WEB-INF/tags/region_widget.tag Thu Dec 13 21:24:21 2012
@@ -52,7 +52,7 @@ Template for rendering a RegionWidget in
<%-- These are toolbar buttons --%>
<div id="widget-${regionWidget.id}-toolbar" class="widget-toolbar <c:if test="${isLocked}">hidden</c:if>">
<div id="widget-${regionWidget.id}-widget-menu-wrapper" class="dropdown widget-menu-wrapper">
- <a id="widget-${regionWidget.id}-menu-button" class="dropdown-toggle" data-toggle="dropdown">
+ <a id="widget-${regionWidget.id}-menu-button" class="dropdown-toggle" onclick="rave.layout.addIframeOverlays(event)">
<i class="icon-cog"></i>
</a>
<ul id="widget-${regionWidget.id}-menu" class="dropdown-menu widget-menu">
Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less?rev=1421545&r1=1421544&r2=1421545&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/css/rave-css.less Thu Dec 13 21:24:21 2012
@@ -137,6 +137,7 @@
.widget-wrapper {
vertical-align: top;
margin-bottom: 20px;
+ position: relative;
/* prevents adjusting of other gadgets when gadget is being dragged */
border: 1px solid #cfcfcf;
border-radius: 5px;
Modified: rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_layout.js
URL: http://svn.apache.org/viewvc/rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_layout.js?rev=1421545&r1=1421544&r2=1421545&view=diff
==============================================================================
--- rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_layout.js (original)
+++ rave/trunk/rave-portal-resources/src/main/webapp/static/script/rave_layout.js Thu Dec 13 21:24:21 2012
@@ -628,12 +628,14 @@ rave.layout = rave.layout || (function()
*/
function hideMenu(widgetId) {
$("#widget-" + widgetId + "-menu").hide();
+ $(".iframe-overlay").remove();
}
/**
* Hides all widget menus
*/
function hideAllMenus() {
$(".widget-menu").hide();
+ $(".iframe-overlay").remove();
}
/**
* Shows the widget menu for a specific widget
@@ -790,6 +792,31 @@ rave.layout = rave.layout || (function()
enableEditPrefsMenuItem: enableEditPrefsMenuItem
}
})();
+
+ function addIframeOverlays(event){
+ //e.preventDefault();
+
+ var i = 0;
+ $(".widget").each(function(){
+ var W = $(this).outerWidth(),
+ H = $(this).outerHeight(),
+ X = $(this).position().left,
+ Y = $(this).position().top;
+
+ $(this).after('<div class="iframe-overlay" onclick="rave.layout.hideWidgetMenu()" />');
+ $(this).next('.iframe-overlay').css({
+ width: W,
+ height: H,
+ position: "absolute",
+ top: Y,
+ left: X
+ });
+
+ });
+
+ // Remove any overlays onclick of all the things!!!
+ $("*:not(.dropdown-toggle)").on("click", function(){ $(".iframe-overlay").remove(); });
+ }
/**
* Submits the RPC call to move the widget to a new page
@@ -1045,6 +1072,7 @@ rave.layout = rave.layout || (function()
closePageDialogTabbed: closePageDialogTabbed,
moveWidgetToPage: moveWidgetToPage,
searchHandler : searchHandler,
- isWidgetOnHiddenTab: isWidgetOnHiddenTab
+ isWidgetOnHiddenTab: isWidgetOnHiddenTab,
+ addIframeOverlays: addIframeOverlays
};
})();