mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-14 08:34:26 +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
|
@ -10,6 +10,11 @@ var GLOBAL = {
|
|||
isAnimating: false
|
||||
};
|
||||
|
||||
var VIEWPORT = {
|
||||
minZoom: 1,
|
||||
maxZoom: 1.15
|
||||
};
|
||||
|
||||
var GRAPHICS = {
|
||||
arrowHeadSize: 8,
|
||||
|
||||
|
@ -43,4 +48,5 @@ var GRAPHICS = {
|
|||
exports.GLOBAL = GLOBAL;
|
||||
exports.TIME = TIME;
|
||||
exports.GRAPHICS = GRAPHICS;
|
||||
exports.VIEWPORT = VIEWPORT;
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@ exports.isBrowser = function() {
|
|||
return inBrowser;
|
||||
};
|
||||
|
||||
|
||||
exports.splitTextCommand = function(value, func, context) {
|
||||
func = _.bind(func, context);
|
||||
_.each(value.split(';'), function(command, index) {
|
||||
|
|
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