Files
ionic-framework/js/angular/service/clickBlock.js
Adam Bradley e9f0fcf556 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.
2014-08-27 12:56:12 -05:00

25 lines
518 B
JavaScript

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');
}
};
}]);