mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-08 05:34:27 +02:00
tried out zoom level, shows 2 for some reason
This commit is contained in:
parent
6e61ffda59
commit
f60b97307a
7 changed files with 3152 additions and 2877 deletions
16
src/js/util/zoomLevel.js
Normal file
16
src/js/util/zoomLevel.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
var _ = require('underscore');
|
||||
|
||||
var setupZoomPoll = function(callback, context) {
|
||||
var currentZoom = 0;
|
||||
|
||||
setInterval(function() {
|
||||
var newZoom = window.outerWidth / window.innerWidth;
|
||||
if (newZoom !== currentZoom) {
|
||||
currentZoom = newZoom;
|
||||
callback.apply(context, [newZoom]);
|
||||
}
|
||||
}, 100);
|
||||
};
|
||||
|
||||
exports.setupZoomPoll = setupZoomPoll;
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue