Skip to content

Commit

Permalink
feature/bookmark-list — Remove a forced reflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandat committed May 4, 2016
1 parent beda918 commit 0271df3
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions app/favourite/favourite-list.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,22 @@

function navigate(fave, $event) {
// I deactivated highlight on items because I don't want to see a flickering when swiping on an item.
// Thus when clicking an item, we need to add it our self.
$event.currentTarget.classList.add('activated');
// Thus when clicking an item, we need to add the right class our self.
ionic.DomUtil.requestAnimationFrame(addClass);
if (fave.type === 'character') {
$state.go('app.characterDetailInModal', {character: fave});
} else {
$state.go('app.comicDetailInModal', {comic: fave});
}
$timeout(removeClass, 200);
$timeout(_.wrap(removeClass, ionic.DomUtil.requestAnimationFrame), 200);
////////////
function addClass(){
$event.currentTarget.classList.add('activated');
$log.debug('Added activated class');
}
function removeClass(){
$event.currentTarget.classList.remove('activated');
$log.debug('Removed activated class');
}
}
}
Expand Down

0 comments on commit 0271df3

Please sign in to comment.