Skip to content

Commit

Permalink
Remove new highlight on drag
Browse files Browse the repository at this point in the history
  • Loading branch information
jtvberg committed Sep 27, 2020
1 parent 127dd50 commit 28ddba2
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions renderer/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,13 @@ function changeWatch (box) {
observer.observe(targetNode, config)
}

// Add card to known list handler
function highlightCard (id) {
knownList.push(getColor($(`#${id}`)) + '' + id)
localStorage.setItem('knownList', JSON.stringify([...new Set(knownList)]))
highlightCards()
}

// Highlight newly added cards via diff from knownList (which would include color change)
function highlightCards () {
const cl = createKnown()
Expand Down Expand Up @@ -1618,6 +1625,7 @@ const allowDrop = (e) => {
// eslint-disable-next-line no-unused-vars
const drag = (e) => {
e.dataTransfer.setData('text', e.target.id)
highlightCard(e.target.id)
}

// eslint-disable-next-line no-unused-vars
Expand Down Expand Up @@ -1675,9 +1683,7 @@ $(document).on('click', '.card', function (e) {
window.activeTask = parseInt(id) || id
$('.card').removeClass('card-selected')
if ($(`#${id}`).hasClass('card-new-highlighted')) {
knownList.push(getColor($(e.currentTarget)) + '' + id)
localStorage.setItem('knownList', JSON.stringify([...new Set(knownList)]))
highlightCards()
highlightCard(id)
}
if ($(`#${id}`).offset()) {
$(`#${id}`).removeClass('card-new-highlighted').addClass('card-selected').parent().animate({ scrollTop: $(`#${id}`).offset().top - $(`#${id}`).parent().offset().top + $(`#${id}`).parent().scrollTop() })
Expand Down

0 comments on commit 28ddba2

Please sign in to comment.