Fossil SCM

Possible solution to the problem of buttons randomly jumping away from under the mouse cursor.

florian 2021-09-25 08:57 diff-js-fetchqueue
Commit b4dbdec8f1442c95931f2b508dab77b4f7e440d06d37ca86810de36473875204
1 file changed +4 -2
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -175,11 +175,11 @@
175175
if(this.pos.prev && this.pos.next
176176
&& ((this.pos.next.startLhs - this.pos.prev.endLhs)
177177
<= Diff.config.chunkLoadLines)){
178178
/* Place a single button to load the whole block, rather
179179
than separate up/down buttons. */
180
- btnDown = false;
180
+ btnDown = this.createButton(this.FetchType.FillGap);
181181
btnUp = this.createButton(this.FetchType.FillGap);
182182
}else{
183183
/* Figure out which chunk-load buttons to add... */
184184
if(this.pos.prev){
185185
btnDown = this.createButton(this.FetchType.PrevDown);
@@ -285,11 +285,13 @@
285285
*/
286286
maybeReplaceButtons: function(){
287287
if(this.pos.next && this.pos.prev
288288
&& (this.pos.endLhs - this.pos.startLhs <= Diff.config.chunkLoadLines)){
289289
D.clearElement(this.e.btnWrapper);
290
- D.append(this.e.btnWrapper, this.createButton(this.FetchType.FillGap));
290
+ for( var i=0; i<2; i++ ){
291
+ D.append(this.e.btnWrapper, this.createButton(this.FetchType.FillGap));
292
+ }
291293
if( this.$fetchQueue && this.$fetchQueue.length>0 ){
292294
this.$fetchQueue = [this.FetchType.FillGap];
293295
}
294296
}
295297
return this;
296298
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -175,11 +175,11 @@
175 if(this.pos.prev && this.pos.next
176 && ((this.pos.next.startLhs - this.pos.prev.endLhs)
177 <= Diff.config.chunkLoadLines)){
178 /* Place a single button to load the whole block, rather
179 than separate up/down buttons. */
180 btnDown = false;
181 btnUp = this.createButton(this.FetchType.FillGap);
182 }else{
183 /* Figure out which chunk-load buttons to add... */
184 if(this.pos.prev){
185 btnDown = this.createButton(this.FetchType.PrevDown);
@@ -285,11 +285,13 @@
285 */
286 maybeReplaceButtons: function(){
287 if(this.pos.next && this.pos.prev
288 && (this.pos.endLhs - this.pos.startLhs <= Diff.config.chunkLoadLines)){
289 D.clearElement(this.e.btnWrapper);
290 D.append(this.e.btnWrapper, this.createButton(this.FetchType.FillGap));
 
 
291 if( this.$fetchQueue && this.$fetchQueue.length>0 ){
292 this.$fetchQueue = [this.FetchType.FillGap];
293 }
294 }
295 return this;
296
--- src/fossil.diff.js
+++ src/fossil.diff.js
@@ -175,11 +175,11 @@
175 if(this.pos.prev && this.pos.next
176 && ((this.pos.next.startLhs - this.pos.prev.endLhs)
177 <= Diff.config.chunkLoadLines)){
178 /* Place a single button to load the whole block, rather
179 than separate up/down buttons. */
180 btnDown = this.createButton(this.FetchType.FillGap);
181 btnUp = this.createButton(this.FetchType.FillGap);
182 }else{
183 /* Figure out which chunk-load buttons to add... */
184 if(this.pos.prev){
185 btnDown = this.createButton(this.FetchType.PrevDown);
@@ -285,11 +285,13 @@
285 */
286 maybeReplaceButtons: function(){
287 if(this.pos.next && this.pos.prev
288 && (this.pos.endLhs - this.pos.startLhs <= Diff.config.chunkLoadLines)){
289 D.clearElement(this.e.btnWrapper);
290 for( var i=0; i<2; i++ ){
291 D.append(this.e.btnWrapper, this.createButton(this.FetchType.FillGap));
292 }
293 if( this.$fetchQueue && this.$fetchQueue.length>0 ){
294 this.$fetchQueue = [this.FetchType.FillGap];
295 }
296 }
297 return this;
298

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button