diff options
author | tony baldwin <tony@tonybaldwin.org> | 2014-04-12 08:37:56 -0400 |
---|---|---|
committer | tony baldwin <tony@tonybaldwin.org> | 2014-04-12 08:37:56 -0400 |
commit | ebd33b185da1c36e718dfa4a2971c3db35cbda22 (patch) | |
tree | c23cbf55aac433c90ac254d0684dabf9d4528133 /view/tpl/notes.tpl | |
parent | 5cca00ddc79dad667464674e08a2a860e262eabd (diff) | |
parent | d0834c7e1394e1986b2b00e039125deff74d9e5e (diff) | |
download | volse-hubzilla-ebd33b185da1c36e718dfa4a2971c3db35cbda22.tar.gz volse-hubzilla-ebd33b185da1c36e718dfa4a2971c3db35cbda22.tar.bz2 volse-hubzilla-ebd33b185da1c36e718dfa4a2971c3db35cbda22.zip |
Merge remote-tracking branch 'upstream/master'
Conflicts:
view/theme/redbasic/css/style.css
whatever
Diffstat (limited to 'view/tpl/notes.tpl')
-rw-r--r-- | view/tpl/notes.tpl | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/view/tpl/notes.tpl b/view/tpl/notes.tpl index 09932e545..0e8c8017c 100644 --- a/view/tpl/notes.tpl +++ b/view/tpl/notes.tpl @@ -1,8 +1,25 @@ <div class="widget"> <script> -$("#note-text").live('input paste',function(e){ - $.post('notes', { 'note_text' : $('#note-text').val() }); +var noteSaveTimer = null; +$(document).on('focusout',"#note-text",function(e){ + if(noteSaveTimer) + clearTimeout(noteSaveTimer); + notePostFinal(); + noteSaveTimer = null; +}); + +$(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); +} </script> <h3>{{$banner}}</h3> |