1
0
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:
chylex 2017-09-29 18:04:44 +02:00
parent a4841175e8
commit 8c447b1ffb
2 changed files with 10 additions and 3 deletions
Core/Handling
Resources/Scripts

View File

@ -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;

View File

@ -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", {