}\r
\r
private GQuery domManip(GQuery g, DomMan type, Element... elms) {\r
- int size = g.size();\r
JsNodeArray newNodes = JsNodeArray.create();\r
if (elms.length == 0) {\r
elms = elements;\r
if (e.getNodeType() == Node.DOCUMENT_NODE) {\r
e = e.<Document>cast().getBody();\r
}\r
- for (int j = 0; j < size; j++) {\r
+ for (int j = 0, size = g.size(); j < size; j++) {\r
// Widget w = getAssociatedWidget(g.get(j));\r
// GqUi.detachWidget(w);\r
\r
Node n = g.get(j);\r
// If an element selected is inserted elsewhere, it will be moved into the target (not cloned).\r
// If there is more than one target element, however, cloned copies of the inserted element will be created for each target after the first\r
- if (size > 1 || i > 0) {\r
+ if (i > 0) {\r
n = n.cloneNode(true);\r
}\r
switch (type) {\r