From: <rm...@hy...> - 2009-12-01 19:28:28
|
Author: rmorgan Date: 2009-12-01 11:28:14 -0800 (Tue, 01 Dec 2009) New Revision: 14015 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14015 Modified: trunk/src/org/hyperic/hq/hqu/rendit/html/DojoUtil.groovy Log: Add javascript that is run on table refresh to override --moz-user-select: none on elements within Dojo tables. This allows for cut and paste from these pages. [HQ-1953] Modified: trunk/src/org/hyperic/hq/hqu/rendit/html/DojoUtil.groovy =================================================================== --- trunk/src/org/hyperic/hq/hqu/rendit/html/DojoUtil.groovy 2009-12-01 10:51:49 UTC (rev 14014) +++ trunk/src/org/hyperic/hq/hqu/rendit/html/DojoUtil.groovy 2009-12-01 19:28:14 UTC (rev 14015) @@ -443,6 +443,22 @@ ${tableVar}.store.clearData(); } + // Called after refreshTable() to make rows selectable. + function ${idVar}_makeSelectable() { + dojo11.setSelectable('${id}', true); + var rows = dojo11.byId("${id}").rows; + for (var x = 0; x < rows.length; x++) { + try { + dojo11.setSelectable(rows[x], true); // Override --moz-user-select: none; + for(var y = 0; y < rows[x].cells.length; y++) { + dojo11.setSelectable(rows[x].cells[y], true); // Override --moz-user-select: none; + } + } catch(e) { + console.log(e); + } + } + } + function ${id}_refreshTable(kwArgs) { // Don't refresh data for this table if it's hidden. var tableWrapper = dojo.byId("${id}_tableWrapper"); @@ -496,6 +512,8 @@ } else { dojo.event.topic.publish("XHRComplete", "DATA_RETURNED"); } + + ${idVar}_makeSelectable(); } }); } |