Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Existing comment node in html file cause problem when try to sync first time #6

Closed
fzh90 opened this issue Aug 12, 2015 · 1 comment

Comments

@fzh90
Copy link
Contributor

fzh90 commented Aug 12, 2015

I have the exisiting dom I want to sync.

<div id="shared_canvas">
  <!-- simple comment node -->
</div>

I can confirm the error below occurs with both normal html and svg element with comment node inside.
The reason is this._model.val("tagname") returns undefined.

Element.prototype.getDom = function() { 
      var attr_name, attr_value, child, dom, i, setClasses, that, _i, _len, _ref, _ref1;
      this._checkForModel();
      if (this._dom == null) {
        //added support for svg elements using document.createElementNS
        var svg = this._model.val("tagname").match(/g|svg|rect|line|path|ellipse|text|tspan|defs|symbol|use|linearGradient|pattern/g);
        if (svg != null) {
          this._dom = document.createElementNS('http://www.w3.org/2000/svg', this._model.val("tagname"));
        }
        else {
          this._dom = document.createElement(this._model.val("tagname"));
        }

getdom undefined

@dmonad dmonad closed this as completed in 367f8d6 Aug 14, 2015
@dmonad
Copy link
Contributor

dmonad commented Aug 14, 2015

Thanks for reporting this. I fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants