mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 17:27:22 +02:00
scrolling fixed, no moreblinking cursor
This commit is contained in:
parent
1bbdb5d6a0
commit
b22f439a43
2 changed files with 13 additions and 4 deletions
|
@ -77,6 +77,8 @@ var CommandPromptView = Backbone.View.extend({
|
||||||
|
|
||||||
// now mutate the cursor...
|
// now mutate the cursor...
|
||||||
this.cursorUpdate(el.value.length, el.selectionStart, el.selectionEnd);
|
this.cursorUpdate(el.value.length, el.selectionStart, el.selectionEnd);
|
||||||
|
// and scroll down due to some weird bug
|
||||||
|
events.trigger('commandScrollDown');
|
||||||
},
|
},
|
||||||
|
|
||||||
cursorUpdate: function(commandLength, selectionStart, selectionEnd) {
|
cursorUpdate: function(commandLength, selectionStart, selectionEnd) {
|
||||||
|
@ -234,6 +236,7 @@ var CommandLineHistoryView = Backbone.View.extend({
|
||||||
this.collection.on('change', this.scrollDown, this);
|
this.collection.on('change', this.scrollDown, this);
|
||||||
|
|
||||||
events.on('issueWarning', this.addWarning, this);
|
events.on('issueWarning', this.addWarning, this);
|
||||||
|
events.on('commandScrollDown', this.scrollDown, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
addWarning: function(msg) {
|
addWarning: function(msg) {
|
||||||
|
@ -256,6 +259,9 @@ var CommandLineHistoryView = Backbone.View.extend({
|
||||||
var t = $('#terminal')[0];
|
var t = $('#terminal')[0];
|
||||||
|
|
||||||
if ($(t).hasClass('scrolling')) {
|
if ($(t).hasClass('scrolling')) {
|
||||||
|
console.log('scrolling');
|
||||||
|
console.log(t.scrollHeight);
|
||||||
|
console.log(t.scrollTop);
|
||||||
t.scrollTop = t.scrollHeight;
|
t.scrollTop = t.scrollHeight;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -281,20 +281,23 @@ p.commandLine span.prompt {
|
||||||
}
|
}
|
||||||
|
|
||||||
#prompt span.cursor {
|
#prompt span.cursor {
|
||||||
|
/*
|
||||||
|
ARGHHHhh why does this cause reflows / scrolls!?!?!? wtf
|
||||||
-webkit-animation-name: blink;
|
-webkit-animation-name: blink;
|
||||||
-webkit-animation-duration: 1s;
|
-webkit-animation-duration: 1s;
|
||||||
-webkit-animation-iteration-count: 99999;
|
-webkit-animation-iteration-count: 99999; */
|
||||||
background: #DDD;
|
background: #DDD;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
@-webkit-keyframes blink {
|
@-webkit-keyframes blink {
|
||||||
from {
|
from {
|
||||||
opacity: 1;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
49% {
|
49% {
|
||||||
opacity: 1;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
|
|
||||||
50% {
|
50% {
|
||||||
|
@ -305,7 +308,7 @@ p.commandLine span.prompt {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
to {
|
to {
|
||||||
opacity: 1;
|
opacity: 0.7;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue