Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

修复因DragAndDrop、FilePaste重用导致的多实例时上述功能无法使用的问题 #3077

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/lib/dnd.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ define([
'../base',
'../mediator',
'../runtime/client'
], function( Base, Mediator, RuntimeClent ) {
], function( Base, Mediator, RuntimeClient ) {

var $ = Base.$;

Expand All @@ -18,15 +18,15 @@ define([
return;
}

RuntimeClent.call( this, 'DragAndDrop' );
RuntimeClient.call( this, 'DragAndDrop', true );//与FilePicker一样为一种文件选择器,不能重用
}

DragAndDrop.options = {
accept: null,
disableGlobalDnd: false
};

Base.inherits( RuntimeClent, {
Base.inherits( RuntimeClient, {
constructor: DragAndDrop,

init: function() {
Expand All @@ -42,4 +42,4 @@ define([
Mediator.installTo( DragAndDrop.prototype );

return DragAndDrop;
});
});
8 changes: 4 additions & 4 deletions src/lib/filepaste.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ define([
'../base',
'../mediator',
'../runtime/client'
], function( Base, Mediator, RuntimeClent ) {
], function( Base, Mediator, RuntimeClient ) {

var $ = Base.$;

function FilePaste( opts ) {
opts = this.options = $.extend({}, opts );
opts.container = $( opts.container || document.body );
RuntimeClent.call( this, 'FilePaste' );
RuntimeClient.call( this, 'FilePaste', true );//与FilePicker一样为一种文件选择器,不能重用
}

Base.inherits( RuntimeClent, {
Base.inherits( RuntimeClient, {
constructor: FilePaste,

init: function() {
Expand All @@ -31,4 +31,4 @@ define([
Mediator.installTo( FilePaste.prototype );

return FilePaste;
});
});