Author: ivol37 at gmail.com
Date: Thu Dec 16 11:00:44 2010
New Revision: 508
Log:
[AMDATU-160] Small fix to prevent JS error upon 'Add gadget'. However, after
adding the gadget still a browser refresh is required. Further investigation
needed.
Modified:
trunk/amdatu-opensocial/dashboard/src/main/resources/static/html/templates.html
trunk/amdatu-opensocial/dashboard/src/main/resources/static/js/dashboard.js
Modified:
trunk/amdatu-opensocial/dashboard/src/main/resources/static/html/templates.html
==============================================================================
---
trunk/amdatu-opensocial/dashboard/src/main/resources/static/html/templates.html
(original)
+++
trunk/amdatu-opensocial/dashboard/src/main/resources/static/html/templates.html
Thu Dec 16 11:00:44 2010
@@ -32,7 +32,7 @@
</span>
</span>
</div>
- <div class="widgetcontent">
+ <div class="widgetcontent" id="widgetcontent_<%= id %>">
</div>
</div>
</script>
Modified:
trunk/amdatu-opensocial/dashboard/src/main/resources/static/js/dashboard.js
==============================================================================
--- trunk/amdatu-opensocial/dashboard/src/main/resources/static/js/dashboard.js
(original)
+++ trunk/amdatu-opensocial/dashboard/src/main/resources/static/js/dashboard.js
Thu Dec 16 11:00:44 2010
@@ -73,13 +73,8 @@
my.LayoutManager.inherits(shindig.LayoutManager);
my.LayoutManager.prototype.getGadgetChrome = function(widget) {
- var chromeContainer = document.getElementById(widget.serviceName);
- var divs = chromeContainer.getElementsByTagName('div');
- for (var i=0;i<divs.length;i++) {
- if (divs[i].getAttribute('class') == 'widgetcontent') {
- return divs[i];
- }
- }
+ var chrome = document.getElementById('widgetcontent_' +
widget.serviceName);
+ return chrome;
};
my.init = function() {