thais-molica / css-template-layout

Automatically exported from code.google.com/p/css-template-layout
0 stars 0 forks source link

DOM entries append twice? #13

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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.

Original issue reported on code.google.com by cdimitro...@hotmail.com on 5 Mar 2012 at 11:41

GoogleCodeExporter commented 9 years ago
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.

Original comment by cdimitro...@hotmail.com on 13 Mar 2012 at 3:25

GoogleCodeExporter commented 9 years ago
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);
}

Original comment by cdimitro...@hotmail.com on 31 May 2012 at 12:41