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

Prepend and after are inconsistent #35

Open
marcelerz opened this issue Jul 24, 2014 · 0 comments
Open

Prepend and after are inconsistent #35

marcelerz opened this issue Jul 24, 2014 · 0 comments

Comments

@marcelerz
Copy link

When having following code:

var morph = Metamorph('foo');

Which results in the following markup:

...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
...

When we call after() on the Metamorph instance:

morph.after("bar");

We get this:

...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
bar
...

The innerHTML is not changed as it is injected after the script-tag.

And when we call prepend() on the Metamorph instance:

morph.prepend("bar");

We get this:

...
<script id="metamorph-0-start" type="text/x-placeholder"></script>
bar
foo
<script id="metamorph-0-end" type="text/x-placeholder"></script>
...

However, the innerHTML is here not modified even though it changed the content between the script-tags, giving incorrect data when innerHTML is requested.

Should there also be a before() and append() function? (I don't mean appendTo() here.)

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

1 participant