forked from extern/egroupware
Make whole edit dialog a drop target - files will be uploaded & linked
Done in the link widget, so any template with link-to should work.
This commit is contained in:
parent
64609cc61e
commit
7e1a785615
@ -203,6 +203,8 @@ var et2_file = et2_inputWidget.extend(
|
||||
var drop_target = widget && widget.getDOMNode() || document.getElementById(this.options.drop_target);
|
||||
if(drop_target)
|
||||
{
|
||||
// Tell jQuery to include this property
|
||||
jQuery.event.props.push('dataTransfer');
|
||||
var self = this;
|
||||
drop_target.ondrop =function(event) {
|
||||
return false;
|
||||
|
@ -212,6 +212,32 @@ var et2_link_to = et2_inputWidget.extend(
|
||||
var file_attrs = {
|
||||
multiple: true,
|
||||
id: this.id + '_file',
|
||||
|
||||
// Make the whole template a drop target
|
||||
drop_target: this.getRoot(),
|
||||
|
||||
// Change to this tab when they drop
|
||||
onStart: function(event, file_count) {
|
||||
// Find the tab widget, if there is one
|
||||
var tabs = self;
|
||||
do {
|
||||
tabs = tabs._parent;
|
||||
} while (tabs != self.getRoot() && tabs._type != 'tabbox');
|
||||
if(tabs != self.getRoot())
|
||||
{
|
||||
// Find the tab index
|
||||
for(var i = 0; i < tabs.tabData.length; i++)
|
||||
{
|
||||
// Find the tab
|
||||
if(tabs.tabData[i].contentDiv.has(self.div).length)
|
||||
{
|
||||
tabs.setActiveTab(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
onFinish: function(event, file_count) {
|
||||
event.data = self;
|
||||
self.filesUploaded(event);
|
||||
|
@ -769,6 +769,7 @@ div.message.floating {
|
||||
background-color: #f3d4d0;
|
||||
border-color: #a93030;
|
||||
background-image:url(images/error.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.message.success {
|
||||
@ -777,6 +778,7 @@ div.message.floating {
|
||||
color: #98a930;
|
||||
border-color: #9ea930;
|
||||
background-image:url(images/tick.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.message.hint {
|
||||
@ -785,6 +787,7 @@ div.message.floating {
|
||||
border-color: #56729a;
|
||||
color: #56729a;
|
||||
background-image:url(images/hint.png);
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user