Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sendToServer(items) {
  2.   $('.game-item', scope).draggable('disable');
  3.  
  4.   var a = {}
  5.   items.forEach(function(item){
  6.    a[item.id] = item;
  7.   });
  8.   // Delay the server request in order to finish the animation
  9.   setTimeout(function() {
  10.    ih.ajax({
  11.     url: 'moveItem',
  12.     type: 'POST',
  13.     module: moduleName,
  14.     data: {
  15.      items: a,
  16.      route: moduleName,
  17.      buildingId: buildingId,
  18.      pcId: hero.id,
  19.      pcType: hero.pcType
  20.     }
  21.    }).then(function(response) {
  22.     $(window).trigger('itemEquipted.' + draggedItem.id);
  23.     $('.game-item', scope).draggable('enable');
  24.  
  25. //    if (response.result && !response.result.success) {
  26. //     ih.updateModule(moduleName, response);
  27. //    }
  28.    });
  29.   }, 250);
  30.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement