mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-14 03:15:49 +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{
|
||||
sealed class DragHandlerBrowser : IDragHandler{
|
||||
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){
|
||||
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", "link", dragData.LinkUrl);
|
||||
TriggerDragStart("link", dragData.LinkUrl);
|
||||
}
|
||||
else if (dragData.IsFragment){
|
||||
TriggerDragStart("text", dragData.FragmentText.Trim());
|
||||
}
|
||||
else{
|
||||
browserControl.ExecuteScriptAsync("window.TDGF_onGlobalDragStart", "unknown");
|
||||
TriggerDragStart("unknown");
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -684,7 +684,7 @@
|
||||
let isDraggingValid = false;
|
||||
|
||||
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", {
|
||||
|
Loading…
Reference in New Issue
Block a user