mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-04-30 14:34:09 +02:00
Fix missing tweet context menu in notification column & when moving across columns
Recent bug caused by changes to the handler, not present in previous release
This commit is contained in:
parent
f091b2526e
commit
1eae380b08
@ -225,6 +225,12 @@
|
|||||||
(function(){
|
(function(){
|
||||||
var lastTweet = "";
|
var lastTweet = "";
|
||||||
|
|
||||||
|
var updateHighlightedColumn = function(ele){
|
||||||
|
highlightedColumnEle = ele;
|
||||||
|
highlightedColumnObj = ele ? TD.controller.columnManager.get(ele.attr("data-column")) : null;
|
||||||
|
return !!highlightedColumnObj;
|
||||||
|
};
|
||||||
|
|
||||||
var updateHighlightedTweet = function(ele, obj, link, embeddedLink){
|
var updateHighlightedTweet = function(ele, obj, link, embeddedLink){
|
||||||
highlightedTweetEle = ele;
|
highlightedTweetEle = ele;
|
||||||
highlightedTweetObj = obj;
|
highlightedTweetObj = obj;
|
||||||
@ -235,24 +241,27 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
app.delegate("section", "mouseenter mouseleave", function(e){
|
app.delegate("section.js-column", "mouseenter mouseleave", function(e){
|
||||||
if (e.type === "mouseenter"){
|
if (e.type === "mouseenter"){
|
||||||
highlightedColumnEle = $(this);
|
if (!highlightedColumnObj){
|
||||||
highlightedColumnObj = TD.controller.columnManager.get(highlightedColumnEle.attr("data-column"));
|
updateHighlightedColumn($(this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (e.type === "mouseleave"){
|
else if (e.type === "mouseleave"){
|
||||||
highlightedColumnEle = null;
|
updateHighlightedColumn(null);
|
||||||
highlightedColumnObj = null;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
app.delegate("article.js-stream-item", "mouseenter mouseleave", function(e){
|
app.delegate("article.js-stream-item", "mouseenter mouseleave", function(e){
|
||||||
if (e.type === "mouseenter"){
|
if (e.type === "mouseenter"){
|
||||||
if (!highlightedColumnObj)return;
|
|
||||||
|
|
||||||
var me = $(this);
|
var me = $(this);
|
||||||
var tweet = highlightedColumnObj.findChirp(me.attr("data-key"));
|
|
||||||
|
|
||||||
|
if (!me[0].hasAttribute("data-tweet-id") || !highlightedColumnObj && !updateHighlightedColumn(me.closest("section.js-column"))){
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var tweet = highlightedColumnObj.findChirp(me.attr("data-tweet-id")) || highlightedColumnObj.findChirp(me.attr("data-key"));
|
||||||
|
|
||||||
if (tweet && tweet.chirpType === TD.services.ChirpBase.TWEET){
|
if (tweet && tweet.chirpType === TD.services.ChirpBase.TWEET){
|
||||||
var link = tweet.getChirpURL();
|
var link = tweet.getChirpURL();
|
||||||
var embedded = tweet.quotedTweet ? tweet.quotedTweet.getChirpURL() : "";
|
var embedded = tweet.quotedTweet ? tweet.quotedTweet.getChirpURL() : "";
|
||||||
|
Loading…
Reference in New Issue
Block a user