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

Error when calling updateContents() method #132

Closed
ericmm opened this issue May 31, 2014 · 4 comments
Closed

Error when calling updateContents() method #132

ericmm opened this issue May 31, 2014 · 4 comments

Comments

@ericmm
Copy link

ericmm commented May 31, 2014

Hi there,

The following JS code throw exception and the message is:
Uncaught TypeError: undefined is not a function quill.js:12702
Editor.applyDelta quill.js:12702
Quill.updateContents quill.js:15658
...

====JS code====
var d = {
startLength: 1,
endLength: 2,
ops: [{
value: 'g',
attributes: {}
}, {
start: 0,
end: 1,
attributes: {}
}]
};
editor.updateContents(d);
====JS code====

is there anything wrong with my code?

Thanks,
Eric

@jhchen jhchen closed this as completed in 2594db7 May 31, 2014
@jhchen
Copy link
Member

jhchen commented May 31, 2014

The docs are a bit misleading in that in the parameters a Delta object is expected but the examples it takes a standard js object. I made a change to take either. I did make some other changes on develop so will need make the necessary documentation changes before making a new release with this fix. Thank you for reporting this.

@ericmm
Copy link
Author

ericmm commented Jun 5, 2014

Thanks, but it still doesn't work on my side, and it throws some Error below:

"Uncaught TypeError: undefined is not a function quill.js:12928"

When I look into the source, it looks like the function isIdentity() is not defined.

=====quill source====
...
if (!delta.isIdentity()) {
...
=====quill source====

could you please check?

thanks,
Eric

@jhchen
Copy link
Member

jhchen commented Jun 6, 2014

It seems to be working on the latest version. Is this what you are doing: http://jsfiddle.net/uA5V8/.

@ericmm
Copy link
Author

ericmm commented Jun 7, 2014

Thanks a lot. I made something wrong, it works.

Appreciate for your response.

Eric

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