this saves notes on the fly. i think this is appropriate behavior for a notes widget. btw... one would get mad at oneself if noting something important and forget to save it. with this behavior one can at least get mad at the developer if something goes wrong :)

This commit is contained in:
marijus 2013-12-11 19:05:50 +01:00
parent aea1e1af82
commit 1add7d381d

View File

@ -1,13 +1,10 @@
<div class="widget">
<script>
function notePost() {
$('#note-rotator').spin('tiny');
$.post('notes', { 'note_text' : $('#note-text').val() },function(data) { $('#note-rotator').spin(false); });
}
$("#note-text").live('input paste',function(e){
$.post('notes', { 'note_text' : $('#note-text').val() });
});
</script>
<h3>{{$banner}}</h3>
<textarea name="note_text" id="note-text">{{$text}}</textarea>
<input type="submit" name="submit" id="note-save" value="{{$save}}" onclick="notePost(); return true;">
<div id="note-rotator"></div>
</div>