forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(clickBlock): add click-block div to body
Instead of using pointer-events: none to disable unwanted clicks which can cause flickering, we’re now using a click-block div that covers the view during transitions. Similar concept to pointer-events: none applied to the body tag, but in tests its showing to be more effective to not cause any flickers.
- Loading branch information
1 parent
2c3f1c9
commit e9f0fcf
Showing
5 changed files
with
61 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
IonicModule | ||
.factory('$ionicClickBlock', [ | ||
'$document', | ||
'$ionicBody', | ||
'$timeout', | ||
function($document, $ionicBody, $timeout) { | ||
var cb = $document[0].createElement('div'); | ||
cb.className = 'click-block'; | ||
return { | ||
show: function() { | ||
if(cb.parentElement) { | ||
cb.classList.remove('hide'); | ||
} else { | ||
$ionicBody.append(cb); | ||
} | ||
$timeout(function(){ | ||
cb.classList.add('hide'); | ||
}, 500); | ||
}, | ||
hide: function() { | ||
cb.classList.add('hide'); | ||
} | ||
}; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters