daily pastebin goal
18%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('.tasklist').bind('drop', function(event, redirectevent) {
  2.     var task;
  3.     if (redirectevent != null) {
  4.         if (redirectevent.originalEvent == null) return false;
  5.         task = redirectevent.originalEvent.dataTransfer.getData("text/plain");
  6.     } else {
  7.         task = event.originalEvent.dataTransfer.getData("text/plain");
  8.     }
  9.     $(event.target).append($('#' + task));
  10.     event.preventDefault();
  11.  
  12.     var taskTitle = $('#' + task).children().eq(1).text();
  13.     addTask(event.target.id, taskTitle);
  14.  
  15.     $(event.target).removeClass('dragover');
  16.  
  17.     $.ajax({
  18.         type: 'POST',
  19.         url: '/proiect/board/',
  20.         data: {
  21.             //You probably store your drop status on your dropped task.
  22.             //You'll have to fetch it.
  23.             task_status: $("2").val(),
  24.             csrfmiddlewaretoken: $('#board_form input[name=csrfmiddlewaretoken]').val(),
  25.         },
  26.     });
  27. });
RAW Paste Data
Top