mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-04 19:54:29 +02:00
nice keyboard refreshing and all htat jazz workingggg
This commit is contained in:
parent
69235f4b37
commit
a2c3fcabf5
3 changed files with 66 additions and 8 deletions
|
@ -8738,11 +8738,25 @@ var ModalView = Backbone.View.extend({
|
||||||
console.warn('stealing keyboard');
|
console.warn('stealing keyboard');
|
||||||
Main.getEventBaton().stealBaton('keydown', this.onKeyDown, this);
|
Main.getEventBaton().stealBaton('keydown', this.onKeyDown, this);
|
||||||
Main.getEventBaton().stealBaton('keyup', this.onKeyUp, this);
|
Main.getEventBaton().stealBaton('keyup', this.onKeyUp, this);
|
||||||
|
Main.getEventBaton().stealBaton('windowFocus', this.onWindowFocus, this);
|
||||||
|
Main.getEventBaton().stealBaton('documentClick', this.onDocumentClick, this);
|
||||||
|
|
||||||
|
$('#commandTextField').blur();
|
||||||
},
|
},
|
||||||
|
|
||||||
releaseKeyboard: function() {
|
releaseKeyboard: function() {
|
||||||
Main.getEventBaton().releaseBaton('keydown', this.onKeyDown, this);
|
Main.getEventBaton().releaseBaton('keydown', this.onKeyDown, this);
|
||||||
Main.getEventBaton().releaseBaton('keyup', this.onKeyUp, this);
|
Main.getEventBaton().releaseBaton('keyup', this.onKeyUp, this);
|
||||||
|
Main.getEventBaton().releaseBaton('windowFocus', this.onWindowFocus, this);
|
||||||
|
Main.getEventBaton().releaseBaton('documentClick', this.onDocumentClick, this);
|
||||||
|
},
|
||||||
|
|
||||||
|
onWindowFocus: function(e) {
|
||||||
|
console.log('window focus doing nothing', e);
|
||||||
|
},
|
||||||
|
|
||||||
|
documentClick: function(e) {
|
||||||
|
console.log('doc click doing nothing', e);
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
onKeyDown: function(e) {
|
||||||
|
@ -8876,8 +8890,16 @@ var init = function(){
|
||||||
};
|
};
|
||||||
focusTextArea();
|
focusTextArea();
|
||||||
|
|
||||||
$(window).focus(focusTextArea);
|
$(window).focus(function(e) {
|
||||||
$(document).click(focusTextArea);
|
eventBaton.trigger('windowFocus', e);
|
||||||
|
});
|
||||||
|
$(document).click(function(e) {
|
||||||
|
eventBaton.trigger('documentClick', e);
|
||||||
|
});
|
||||||
|
|
||||||
|
// the default action on window focus and document click is to just focus the text area
|
||||||
|
eventBaton.stealBaton('windowFocus', focusTextArea);
|
||||||
|
eventBaton.stealBaton('documentClick', focusTextArea);
|
||||||
|
|
||||||
// but when the input is fired in the text area, we pipe that to whoever is
|
// but when the input is fired in the text area, we pipe that to whoever is
|
||||||
// listenining
|
// listenining
|
||||||
|
@ -9001,7 +9023,7 @@ EventBaton.prototype.releaseBaton = function(name, func, context) {
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
throw new Error('did not find that function');
|
throw new Error('did not find that function', func, context, name, arguments);
|
||||||
}
|
}
|
||||||
this.eventMap[name] = newListeners;
|
this.eventMap[name] = newListeners;
|
||||||
};
|
};
|
||||||
|
@ -14282,8 +14304,16 @@ var init = function(){
|
||||||
};
|
};
|
||||||
focusTextArea();
|
focusTextArea();
|
||||||
|
|
||||||
$(window).focus(focusTextArea);
|
$(window).focus(function(e) {
|
||||||
$(document).click(focusTextArea);
|
eventBaton.trigger('windowFocus', e);
|
||||||
|
});
|
||||||
|
$(document).click(function(e) {
|
||||||
|
eventBaton.trigger('documentClick', e);
|
||||||
|
});
|
||||||
|
|
||||||
|
// the default action on window focus and document click is to just focus the text area
|
||||||
|
eventBaton.stealBaton('windowFocus', focusTextArea);
|
||||||
|
eventBaton.stealBaton('documentClick', focusTextArea);
|
||||||
|
|
||||||
// but when the input is fired in the text area, we pipe that to whoever is
|
// but when the input is fired in the text area, we pipe that to whoever is
|
||||||
// listenining
|
// listenining
|
||||||
|
@ -17093,7 +17123,7 @@ EventBaton.prototype.releaseBaton = function(name, func, context) {
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
throw new Error('did not find that function');
|
throw new Error('did not find that function', func, context, name, arguments);
|
||||||
}
|
}
|
||||||
this.eventMap[name] = newListeners;
|
this.eventMap[name] = newListeners;
|
||||||
};
|
};
|
||||||
|
@ -17699,11 +17729,25 @@ var ModalView = Backbone.View.extend({
|
||||||
console.warn('stealing keyboard');
|
console.warn('stealing keyboard');
|
||||||
Main.getEventBaton().stealBaton('keydown', this.onKeyDown, this);
|
Main.getEventBaton().stealBaton('keydown', this.onKeyDown, this);
|
||||||
Main.getEventBaton().stealBaton('keyup', this.onKeyUp, this);
|
Main.getEventBaton().stealBaton('keyup', this.onKeyUp, this);
|
||||||
|
Main.getEventBaton().stealBaton('windowFocus', this.onWindowFocus, this);
|
||||||
|
Main.getEventBaton().stealBaton('documentClick', this.onDocumentClick, this);
|
||||||
|
|
||||||
|
$('#commandTextField').blur();
|
||||||
},
|
},
|
||||||
|
|
||||||
releaseKeyboard: function() {
|
releaseKeyboard: function() {
|
||||||
Main.getEventBaton().releaseBaton('keydown', this.onKeyDown, this);
|
Main.getEventBaton().releaseBaton('keydown', this.onKeyDown, this);
|
||||||
Main.getEventBaton().releaseBaton('keyup', this.onKeyUp, this);
|
Main.getEventBaton().releaseBaton('keyup', this.onKeyUp, this);
|
||||||
|
Main.getEventBaton().releaseBaton('windowFocus', this.onWindowFocus, this);
|
||||||
|
Main.getEventBaton().releaseBaton('documentClick', this.onDocumentClick, this);
|
||||||
|
},
|
||||||
|
|
||||||
|
onWindowFocus: function(e) {
|
||||||
|
console.log('window focus doing nothing', e);
|
||||||
|
},
|
||||||
|
|
||||||
|
documentClick: function(e) {
|
||||||
|
console.log('doc click doing nothing', e);
|
||||||
},
|
},
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
onKeyDown: function(e) {
|
||||||
|
|
|
@ -27,8 +27,16 @@ var init = function(){
|
||||||
};
|
};
|
||||||
focusTextArea();
|
focusTextArea();
|
||||||
|
|
||||||
$(window).focus(focusTextArea);
|
$(window).focus(function(e) {
|
||||||
$(document).click(focusTextArea);
|
eventBaton.trigger('windowFocus', e);
|
||||||
|
});
|
||||||
|
$(document).click(function(e) {
|
||||||
|
eventBaton.trigger('documentClick', e);
|
||||||
|
});
|
||||||
|
|
||||||
|
// the default action on window focus and document click is to just focus the text area
|
||||||
|
eventBaton.stealBaton('windowFocus', focusTextArea);
|
||||||
|
eventBaton.stealBaton('documentClick', focusTextArea);
|
||||||
|
|
||||||
// but when the input is fired in the text area, we pipe that to whoever is
|
// but when the input is fired in the text area, we pipe that to whoever is
|
||||||
// listenining
|
// listenining
|
||||||
|
|
|
@ -127,6 +127,7 @@ var ModalView = Backbone.View.extend({
|
||||||
Main.getEventBaton().stealBaton('keydown', this.onKeyDown, this);
|
Main.getEventBaton().stealBaton('keydown', this.onKeyDown, this);
|
||||||
Main.getEventBaton().stealBaton('keyup', this.onKeyUp, this);
|
Main.getEventBaton().stealBaton('keyup', this.onKeyUp, this);
|
||||||
Main.getEventBaton().stealBaton('windowFocus', this.onWindowFocus, this);
|
Main.getEventBaton().stealBaton('windowFocus', this.onWindowFocus, this);
|
||||||
|
Main.getEventBaton().stealBaton('documentClick', this.onDocumentClick, this);
|
||||||
|
|
||||||
$('#commandTextField').blur();
|
$('#commandTextField').blur();
|
||||||
},
|
},
|
||||||
|
@ -135,12 +136,17 @@ var ModalView = Backbone.View.extend({
|
||||||
Main.getEventBaton().releaseBaton('keydown', this.onKeyDown, this);
|
Main.getEventBaton().releaseBaton('keydown', this.onKeyDown, this);
|
||||||
Main.getEventBaton().releaseBaton('keyup', this.onKeyUp, this);
|
Main.getEventBaton().releaseBaton('keyup', this.onKeyUp, this);
|
||||||
Main.getEventBaton().releaseBaton('windowFocus', this.onWindowFocus, this);
|
Main.getEventBaton().releaseBaton('windowFocus', this.onWindowFocus, this);
|
||||||
|
Main.getEventBaton().releaseBaton('documentClick', this.onDocumentClick, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
onWindowFocus: function(e) {
|
onWindowFocus: function(e) {
|
||||||
console.log('window focus doing nothing', e);
|
console.log('window focus doing nothing', e);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
documentClick: function(e) {
|
||||||
|
console.log('doc click doing nothing', e);
|
||||||
|
},
|
||||||
|
|
||||||
onKeyDown: function(e) {
|
onKeyDown: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue