Author: wesleyhales
Date: 2008-11-25 18:17:27 -0500 (Tue, 25 Nov 2008)
New Revision: 12304
Modified:
branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js
Log:
JBPORTAL-2047 - explain root of problem in dyna.js comments
Modified: branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js 2008-11-25
17:46:47 UTC (rev 12303)
+++ branches/JBoss_Portal_Branch_2_7/theme/src/bin/portal-ajax-war/dyna/dyna.js 2008-11-25
23:17:27 UTC (rev 12304)
@@ -218,13 +218,13 @@
*/
function copyInnerHTML(srcContainer, dstContainer, className)
{
- var srcs = srcContainer.select("." + className);
+ var srcs = Element.getElementsByClassName(srcContainer, className);
if (srcs.length == 1)
{
var src = srcs[0];
//
- var dsts = dstContainer.select("." + className);
+ var dsts = Element.getElementsByClassName(dstContainer, className)
if (dsts.length == 1)
{
var dst = dsts[0];
@@ -303,17 +303,18 @@
};
// Find the draggable regions
- var regions_on_page = $$(".dnd-region");
+ var regions_on_page = $$(".dnd-region");
+ // This is the main cause of
https://jira.jboss.org/jira/browse/JBPORTAL-2047
+ // for some reson, the prototype.js double dollar sign (which is the equivalent of
getElementsByClassName)
+ //is the only function that will give us a proper handle for the "drop" part
to work
+ //TODO - if more problems continue with DnD, this may be the root of the problem
+ //var regions_on_page = document.getElementsByClassName("dnd-region");
// Create draggable regions
for(var i = 0;i < regions_on_page.length;i++) {
+ alert(regions_on_page[i]);
var region = regions_on_page[i];
- try{
- Sortable.create(region,
{dropOnEmpty:true,handle:"dnd-handle",tag:"div",containment:regions_on_page,constraint:false,hoverclass:"dnd-droppable"});
- }catch(e){
- //todo- log error
- }
-
+ Sortable.create(region,
{dropOnEmpty:true,handle:"dnd-handle",tag:"div",containment:regions_on_page,constraint:false,hoverclass:"dnd-droppable"});
}
//
@@ -323,7 +324,7 @@
snapshot();
// Find the dyna portlets
- var portlets_on_page = $$(".partial-refresh-window");
+ var portlets_on_page = $$(".partial-refresh-window");
// Add listener for the dyna windows on the dyna-window element
// and not async-window as this one will have its markup replaced