Implemented the ajax call for updating notes.
[citadel.git] / webcit / static / wclib.js
index e6a57cfaa96951badb4efe67fe06f8b850d415a4..f1e7eaf9f501c2273ce0b3b4e808e9491716f956 100644 (file)
@@ -440,9 +440,19 @@ function NotesDragMouseUp(evt) {
        d = $('note-' + uid_of_note_being_dragged);
        d.style.cursor = saved_cursor_style;
 
-       // Only submit the change if motion actually happened
+       // If any motion actually occurred, submit an ajax http call to record it to the server
        if (note_was_dragged > 0) {
-               alert('FIXME do ajax call to move position x=' + d.style.left + ' y=' + d.style.top);
+               p = 'note_uid=' + uid_of_note_being_dragged
+                       + '&left=' + d.style.left
+                       + '&top=' + d.style.top
+                       + '&r=' + CtdlRandomString();
+               new Ajax.Request(
+                       'ajax_update_note',
+                       {
+                               method: 'post',
+                               parameters: p
+                       }
+               );
        }
 
        uid_of_note_being_dragged = '';