Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sendToServer(items) {
- $('.game-item', scope).draggable('disable');
- var a = {}
- items.forEach(function(item){
- a[item.id] = item;
- });
- // Delay the server request in order to finish the animation
- setTimeout(function() {
- ih.ajax({
- url: 'moveItem',
- type: 'POST',
- module: moduleName,
- data: {
- items: a,
- route: moduleName,
- buildingId: buildingId,
- pcId: hero.id,
- pcType: hero.pcType
- }
- }).then(function(response) {
- $(window).trigger('itemEquipted.' + draggedItem.id);
- $('.game-item', scope).draggable('enable');
- // if (response.result && !response.result.success) {
- // ih.updateModule(moduleName, response);
- // }
- });
- }, 250);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement