function UpadeStickyDraggable(note,x, y, page_id, catalogue_id){ $.ajax({ url: "/sticky/UpdateStickyDraggable", data: { note: note, x: x, y: y, page_id: page_id, catalogue_id: catalogue_id }, type: "POST", cache: false, success: function(res) { }, complete: function(res){ } }); } function ReloadGrid(){ $("#list_sticky").jqGrid("setGridParam", {datatype: "json"}).trigger("reloadGrid"); } var width = $('#image').css('width'); var height = $('#image').css('height'); width = parseInt(width); height = parseInt(height); var x; var y; var sticky_preview_id = $('#sticky_preview_id').val(); var page_id = $('#page_id').val(); var catalogue_id = $('#catalogue_id').val(); var note; $('.viewport').live('mousemove',function(e){ x = e.pageX - this.offsetLeft; y = e.pageY - this.offsetTop; x = x/width; y = y/height; }); $('.marker').live('mouseenter', function(e){ note = $(this).text(); $(this).css({ cursor: 'move' }); $(this).css({ opacity: 0.5 }); $(this).draggable({ cursorAt: { left: 12, top: 29 }, disabled: false, stop: function(){ UpadeStickyDraggable(note,x, y,page_id, catalogue_id); $("#image").imgNotes("clear"); ReloadGrid(); GetAllSticks(); } }); }).live('mouseleave',function(){ $(this).draggable({ disabled: true }); $(this).css({ opacity: 1 }); });
Jakies pomysly?