diff options
author | friendica <info@friendica.com> | 2014-04-10 18:46:22 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-04-10 18:46:22 -0700 |
commit | a798dd767d1d3e7d250db2b9387b754a713c5cce (patch) | |
tree | a8784a09de2711d958661e3c1dbf6128a79ecabd /view/tpl/notes.tpl | |
parent | 9bb7811d741339404ea6b372363c805d41a84794 (diff) | |
download | volse-hubzilla-a798dd767d1d3e7d250db2b9387b754a713c5cce.tar.gz volse-hubzilla-a798dd767d1d3e7d250db2b9387b754a713c5cce.tar.bz2 volse-hubzilla-a798dd767d1d3e7d250db2b9387b754a713c5cce.zip |
push notes widget updates to channel clones on focusout (final save). Don't do this for the auto-save events (every ten seconds) which could generate superfluous network traffic.
Diffstat (limited to 'view/tpl/notes.tpl')
-rw-r--r-- | view/tpl/notes.tpl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl index 3ec57ba12..0e8c8017c 100644 --- a/view/tpl/notes.tpl +++ b/view/tpl/notes.tpl @@ -4,9 +4,7 @@ var noteSaveTimer = null; $(document).on('focusout',"#note-text",function(e){ if(noteSaveTimer) clearTimeout(noteSaveTimer); - noteSaveChanges(); - if(noteSaveTimer) - clearTimeout(noteSaveTimer); + notePostFinal(); noteSaveTimer = null; }); @@ -14,6 +12,10 @@ $(document).on('focusin',"#note-text",function(e){ noteSaveTimer = setTimeout(noteSaveChanges,10000); }); +function notePostFinal() { + $.post('notes/sync', { 'note_text' : $('#note-text').val() }); +} + function noteSaveChanges() { $.post('notes', { 'note_text' : $('#note-text').val() }); noteSaveTimer = setTimeout(noteSaveChanges,10000); |