Export to GitHub

css-template-layout - issue #13

DOM entries append twice?


Posted on Mar 5, 2012 by Grumpy Kangaroo

What steps will reproduce the problem? 1.Have the following display

wrap {

display: "aaaa" "bbbb" "cccc" "ddde" "ffgh" "ijjk" "lmmm" "nnnn" * * * 330px ; } 2.In position: a there is a <style> .a { position:a; } #wrap::slot(a) { background-color: #fff; } </style> <div class="a"> <script> $("a").appendTo(b); </script> <script src="google.map.v3 script here"> </div> 3.jquery appendTo adds twice the element, if check is not added to see if element exists: $.templateLayoutShowOnReady();
$(function() { try { $.setTemplateLayout(); } catch(e) {}
});

What is the expected output? What do you see instead? its expected to have DOM element added only once. I see this added twice. From google.map i also get this: Warning: you have included the Google Maps API multiple times on this page. This may cause unexpected errors.

What version of the product are you using? On what operating system? 1.1.6 Windows 2003, FireFox 10.0.2, same in Google Chrome

Please provide any additional information below.

Comment #1

Posted on Mar 13, 2012 by Grumpy Kangaroo

this happens due to jquery clone() being used in several functions, so any inline scripts would be recalled and those need to be aware of double calls, also when calling redoTemplateLayout() the same happens.

Comment #2

Posted on May 31, 2012 by Grumpy Kangaroo

To fix this you can add in the function getDivDims

if(content) { content.find('script').empty(); //fix: multiple executions of inline script tags testDiv.append(content); }

Status: New

Labels:
Type-Defect Priority-Medium