Fix Opera drag image issue.
This commit is contained in:
parent
ddf5d1ab45
commit
b6dab9eb45
1 changed files with 12 additions and 6 deletions
|
|
@ -35,17 +35,17 @@ var dom = require("../lib/dom");
|
|||
var event = require("../lib/event");
|
||||
var useragent = require("../lib/useragent");
|
||||
|
||||
// Safari accepts either image or element (but it must present in the DOM)
|
||||
var proxy = dom.createElement('img');
|
||||
// Safari crashes without image data
|
||||
proxy.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
||||
|
||||
function DragdropHandler(mouseHandler) {
|
||||
|
||||
var editor = mouseHandler.editor;
|
||||
|
||||
// Safari accepts either image or element (but it must present in the DOM)
|
||||
var proxy = dom.createElement("img");
|
||||
// Safari crashes without image data
|
||||
proxy.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
|
||||
|
||||
if (useragent.isOpera) {
|
||||
proxy.style.cssText = 'width:1px;height:1px;position:fixed;top:0;z-index:-1';
|
||||
proxy.style.cssText = "width:1px;height:1px;position:fixed;top:0;left:0;z-index:2147483647;opacity:0;visibility:hidden";
|
||||
editor.container.appendChild(proxy);
|
||||
}
|
||||
|
||||
|
|
@ -73,6 +73,12 @@ function DragdropHandler(mouseHandler) {
|
|||
}, 0);
|
||||
return e.preventDefault();
|
||||
}
|
||||
if (useragent.isOpera) {
|
||||
proxy.style.visibility = "visible";
|
||||
setTimeout(function(){
|
||||
proxy.style.visibility = "hidden";
|
||||
}, 0);
|
||||
}
|
||||
range = editor.getSelectionRange();
|
||||
|
||||
var dataTransfer = e.dataTransfer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue