luckyshot / agilescrumfortrello

'Agile SCRUM for Trello boards' is a Google Chrome extension that gives super-powers to your Trello boards by enabling SCRUM features (Story Points, Tags, Progress Bars, Time Spent and more)
http://xaviesteve.com/5109/agile-scrum-trello-boards/
GNU General Public License v2.0
77 stars 29 forks source link

If I change a date or check a checkbox in a list the changes are not shown on the card #5

Open luckyshot opened 8 years ago

luckyshot commented 8 years ago

If I change a date or check a checkbox in a list the changes are not shown on the card. If the extension is deaktivated it works fine. I am using chrome version 43.0.2357.124 and also tried the portable version 43.0.2357.130

luckyshot commented 8 years ago

Problem is that the extension doesn't see a change in the board.

It needs better change detection, previous versions relied on a 5 second timer interval that did a content length count to see if anything had been modified, although it wasn't the best performant way, so I changed it to a mouseup+keyup event attached to although it is not very reliant.

Anyone got good ideas on how to solve this?

JorgeBoscan commented 8 years ago

This works for refreshing the cards as soon as the user exits the card detail page.

var regexShortLink      = /c\/([^/]+)\/.+/g;
$('.window-wrapper').bind("DOMSubtreeModified",function(){
    if (window.location.href.match(regexShortLink) && !cardDetailOpen)
    {
        cardId = regexShortLink.exec(window.location.href)[1];
        regexShortLink.lastIndex = 0;
        cardDetailOpen = true;
    } else if (!window.location.href.match(regexShortLink) && cardDetailOpen)
    {
        cardDetailOpen = false;
        _run();
    }
});