jonessieka / explorercanvas

Automatically exported from code.google.com/p/explorercanvas
Apache License 2.0
0 stars 0 forks source link

Suggested patch to support dynamically created canvas elements #46

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
var G_vmlCanvasManager_ = {
  init: function(opt_doc) {
    if (/MSIE/.test(navigator.userAgent) && !window.opera) {
      var doc = opt_doc || document;
      // Create a dummy element so that IE will allow canvas elements to be
      // recognized.
      doc.createElement('canvas');
      doc.attachEvent('onreadystatechange', bind(this.init_, this, doc));
+     // BEGIN lab.veille.jp patch
+     // Patch document's createElement
+     var oldcreate=doc.createElement;
+     doc.createElement=function(tag) {var el=oldcreate(tag);if
(tag=='canvas') {G_vmlCanvasManager.initElement(el);};return el;} 
+     // END lab.veille.jp patch
    }    
  },   

Original issue reported on code.google.com by julien.c...@gmail.com on 11 Sep 2009 at 8:05

GoogleCodeExporter commented 9 years ago

Original comment by erik.arv...@gmail.com on 17 Sep 2009 at 2:13