mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
dropping object on clipboard uses ajax to add object to clipboard
This commit is contained in:
parent
9e65ebc152
commit
a85a620d80
|
@ -199,7 +199,7 @@ $(document).ready( function() {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('a.addtoclipboard').click(function(ev){
|
$('body').on('click', 'a.addtoclipboard', function(ev){
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
attr_rel = $(ev.currentTarget).attr('rel');
|
attr_rel = $(ev.currentTarget).attr('rel');
|
||||||
attr_msg = $(ev.currentTarget).attr('msg');
|
attr_msg = $(ev.currentTarget).attr('msg');
|
||||||
|
@ -446,7 +446,35 @@ function onAddClipboard(ev) {
|
||||||
source_type = ev.dataTransfer.getData("type");
|
source_type = ev.dataTransfer.getData("type");
|
||||||
source_id = ev.dataTransfer.getData("id");
|
source_id = ev.dataTransfer.getData("id");
|
||||||
if(source_type == 'document' || source_type == 'folder') {
|
if(source_type == 'document' || source_type == 'folder') {
|
||||||
url = "../op/op.AddToClipboard.php?id="+source_id+"&type="+source_type;
|
$.get('../op/op.Ajax.php',
|
||||||
document.location = url;
|
{ command: 'addtoclipboard', type: source_type, id: source_id },
|
||||||
|
function(data) {
|
||||||
|
console.log(data);
|
||||||
|
if(data.success) {
|
||||||
|
$("#main-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=mainclipboard')
|
||||||
|
$("#menu-clipboard").html('Loading').load('../op/op.Ajax.php?command=view&view=menuclipboard')
|
||||||
|
noty({
|
||||||
|
text: attr_msg,
|
||||||
|
type: 'success',
|
||||||
|
dismissQueue: true,
|
||||||
|
layout: 'topRight',
|
||||||
|
theme: 'defaultTheme',
|
||||||
|
timeout: 1500,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
noty({
|
||||||
|
text: data.message,
|
||||||
|
type: 'error',
|
||||||
|
dismissQueue: true,
|
||||||
|
layout: 'topRight',
|
||||||
|
theme: 'defaultTheme',
|
||||||
|
timeout: 3500,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'json'
|
||||||
|
);
|
||||||
|
//url = "../op/op.AddToClipboard.php?id="+source_id+"&type="+source_type;
|
||||||
|
//document.location = url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user