-
Notifications
You must be signed in to change notification settings - Fork 334
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
Disable localStorage persistence #141
Comments
Why do you need to disable it? localStorage is in there so itll work offline or if saving to the DB fails. You could set autoSave to false tho if you wanted. I'm curious why you need to disable it tho so I can handle your use case. |
It is because my app does and will not require it. I tried to set autoSave to false but I encounter the following problem: -> http://jsbin.com/etudol/edit#javascript,html will not work anymore because file.content is empty |
On a side note, regarding the jsbin code in the above comment, Is it possible to get the contents (on editor update) from the contenteditable iframe instead of file.content? ... |
You'd have to manually get the content out with like: editor.getElement('editor').body.innerText Or something. But if it just that your app doesn't require it, not that it breaks anything, why can't you just ignore it? It should be all behind the scenes. |
I changed it to but it still does not work. The problem also with autoSave not being false is that the file contents is loaded on load. I don't want that behavior. with autoSave = false, the previewer does not work anymore and the (on update) event does not trigger anymore |
The I need to fix #137 which will make it possible to not have localStorage for another reason entirely (because the editor needs to work via But, if you don't have any actual breaking problems with localStorage, just don't need it, I suggest just using it for now and ill add that option ASAP. |
Ok I could live with it for now but how do I configure it in such a way that when everytime the page loads, the content area will be blank. ( I don't want it to be filled with the localStorage data when the page loads). Or, everytime the page loads, clear the localstorage data P.S. im a backend dev.. not much skills on client side |
You could just do |
… also makes it so EE wont crash when localStorage is undefined (IE7 and also when IE9 is using the file protocol)
@levint could you pull develop and let me know if this will work for you now? I added an option I haven't added the docs or tests for it yet so hopefully it doesn't break anything, but if it does let me know! :) |
Added docs and tests, so closing, but feel free to reopen if you are still having problems. |
Thank you! It's working great :) |
@levint Glad to hear it! 👍 |
How to disable localStorage support? .. I only persist the markdown into a server-side database
The text was updated successfully, but these errors were encountered: