diff --git a/www/js/NotePostNotes.class.js b/www/js/NotePostNotes.class.js index 065ced1..fcf95c1 100644 --- a/www/js/NotePostNotes.class.js +++ b/www/js/NotePostNotes.class.js @@ -116,6 +116,8 @@ class NotePostNotes extends Notes { } }); } + + /** * Sync notes with the NotePost server, resolving conflicts in the process. * @@ -123,8 +125,6 @@ class NotePostNotes extends Notes { * @param {function} error * @returns {undefined} */ - - sync(success, error) { super.sync(); var self = this; diff --git a/www/js/Notes.class.js b/www/js/Notes.class.js index 60cf3fa..db206b0 100644 --- a/www/js/Notes.class.js +++ b/www/js/Notes.class.js @@ -112,8 +112,7 @@ class Notes { if (typeof note.html !== 'string') { note.html = marked(note.content); - } // Save - + } return note; } diff --git a/www/js/home.js b/www/js/home.js index e3f50d2..01a8fa2 100644 --- a/www/js/home.js +++ b/www/js/home.js @@ -6,9 +6,43 @@ $(".view-main").on("ptr:refresh", ".ptr-content", function () { - restartApplication(); + loadCards(function () { + app.ptr.done(); + }); }); +function loadCards(callback) { + // Do it twice as a workaround for the stupid sync issue + NOTES.sync(function () { + NOTES.sync(function (notes) { + for (i in window.shuffleInstance.items) { + window.shuffleInstance.remove(window.shuffleInstance.items[i]); + } + $(".notecard-col").remove(); + for (n in notes) { + var note = notes[n]; + $("#notecards-bin").append('