mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 01:10:04 +02:00
made big progress
This commit is contained in:
parent
9b77632faf
commit
d7bb4064dc
6 changed files with 3392 additions and 2249 deletions
|
@ -63,7 +63,7 @@ var init = function() {
|
|||
events.trigger('resize', e);
|
||||
});
|
||||
|
||||
$(window).on('windowSizeCheck', _.throttle(function(e) {
|
||||
$(window).on('resize', _.throttle(function(e) {
|
||||
var width = $(window).width();
|
||||
var height = $(window).height();
|
||||
eventBaton.trigger('windowSizeCheck', {w: width, h: height});
|
||||
|
@ -109,6 +109,7 @@ var init = function() {
|
|||
|
||||
$('#commandTextField').on('keydown', makeKeyListener('keydown'));
|
||||
$('#commandTextField').on('keyup', makeKeyListener('keyup'));
|
||||
$(window).trigger('resize');
|
||||
|
||||
/* hacky demo functionality */
|
||||
if (/\?demo/.test(window.location.href)) {
|
||||
|
|
|
@ -12,7 +12,9 @@ var GLOBAL = {
|
|||
|
||||
var VIEWPORT = {
|
||||
minZoom: 0.66,
|
||||
maxZoom: 1.25
|
||||
maxZoom: 1.25,
|
||||
minWidth: 600,
|
||||
minHeight: 600
|
||||
};
|
||||
|
||||
var GRAPHICS = {
|
||||
|
|
|
@ -149,7 +149,6 @@ var CommandPromptView = Backbone.View.extend({
|
|||
// now for positioning
|
||||
var leftOffset = String(widthPerChar * (selectionStart % numCharsPerLine)) + 'px';
|
||||
var topOffset = String(Math.floor(selectionStart / numCharsPerLine) * heightPerRow) + 'px';
|
||||
console.log('height per row', heightPerRow, 'selection start', selectionStart, 'num chars perline', numCharsPerLine);
|
||||
|
||||
// one reflow? :D
|
||||
$(this.commandCursor).css({
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
qvar GitError = require('../util/errors').GitError;
|
||||
var GitError = require('../util/errors').GitError;
|
||||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
// horrible hack to get localStorage Backbone plugin
|
||||
|
@ -417,7 +417,7 @@ var ViewportAlert = Backbone.View.extend({
|
|||
}
|
||||
});
|
||||
|
||||
var WindowSizeAlertWindow = Backbone.View.extend({
|
||||
var WindowSizeAlertWindow = ViewportAlert.extend({
|
||||
initialize: function(options) {
|
||||
this.eventBatonName = 'windowSizeCheck';
|
||||
this.markdowns = [
|
||||
|
@ -425,19 +425,19 @@ var WindowSizeAlertWindow = Backbone.View.extend({
|
|||
'Please resize your window back to a supported size',
|
||||
'',
|
||||
'(and of course, pull requests to fix this are appreciated :D)'
|
||||
]
|
||||
ZoomAlertWindow.__super__.initialize.apply(this, [options]);
|
||||
];
|
||||
WindowSizeAlertWindow.__super__.initialize.apply(this, [options]);
|
||||
},
|
||||
|
||||
batonFired: function(size) {
|
||||
if (size.w < Constants.VIEWPORT.minWidth ||
|
||||
size.h < Constants.VIEWPORT.minHeight) {
|
||||
if (size.w > Constants.VIEWPORT.minWidth &&
|
||||
size.h > Constants.VIEWPORT.minHeight) {
|
||||
this.finish();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var ZoomAlertWindow = Backbone.View.extend({
|
||||
var ZoomAlertWindow = ViewportAlert.extend({
|
||||
initialize: function(options) {
|
||||
this.eventBatonName = 'zoomChange';
|
||||
this.markdowns = [
|
||||
|
@ -445,7 +445,7 @@ var ZoomAlertWindow = Backbone.View.extend({
|
|||
'Please zoom back to a supported zoom level with Ctrl + and Ctrl -',
|
||||
'',
|
||||
'(and of course, pull requests to fix this are appreciated :D)'
|
||||
]
|
||||
];
|
||||
ZoomAlertWindow.__super__.initialize.apply(this, [options]);
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue