mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-17 21:15:47 +02:00
Maybe fix dragged tweet links not being recognized from certain drag sources
This commit is contained in:
parent
a4841175e8
commit
8c447b1ffb
@ -4,11 +4,18 @@
|
|||||||
namespace TweetDuck.Core.Handling{
|
namespace TweetDuck.Core.Handling{
|
||||||
sealed class DragHandlerBrowser : IDragHandler{
|
sealed class DragHandlerBrowser : IDragHandler{
|
||||||
public bool OnDragEnter(IWebBrowser browserControl, IBrowser browser, IDragData dragData, DragOperationsMask mask){
|
public bool OnDragEnter(IWebBrowser browserControl, IBrowser browser, IDragData dragData, DragOperationsMask mask){
|
||||||
|
void TriggerDragStart(string type, string data = null){
|
||||||
|
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", type, data);
|
||||||
|
}
|
||||||
|
|
||||||
if (dragData.IsLink){
|
if (dragData.IsLink){
|
||||||
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", "link", dragData.LinkUrl);
|
TriggerDragStart("link", dragData.LinkUrl);
|
||||||
|
}
|
||||||
|
else if (dragData.IsFragment){
|
||||||
|
TriggerDragStart("text", dragData.FragmentText.Trim());
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", "unknown");
|
TriggerDragStart("unknown");
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -684,7 +684,7 @@
|
|||||||
let isDraggingValid = false;
|
let isDraggingValid = false;
|
||||||
|
|
||||||
window.TDGF_onGlobalDragStart = function(type, data){
|
window.TDGF_onGlobalDragStart = function(type, data){
|
||||||
isDraggingValid = type === "link" && tweetRegex.test(data);
|
isDraggingValid = (type === "link" || type === "text") && tweetRegex.test(data);
|
||||||
};
|
};
|
||||||
|
|
||||||
app.delegate("section.js-column", {
|
app.delegate("section.js-column", {
|
||||||
|
Loading…
Reference in New Issue
Block a user