Do not cycle through board pages with Index Navigation or See next/previous thread keybinds.
This commit is contained in:
parent
eee2defe4d
commit
48afb6d880
@ -947,13 +947,15 @@
|
|||||||
keybinds.img(thread);
|
keybinds.img(thread);
|
||||||
break;
|
break;
|
||||||
case conf.nextThread:
|
case conf.nextThread:
|
||||||
nav.next();
|
if (g.REPLY) return;
|
||||||
|
nav.scroll(+1);
|
||||||
break;
|
break;
|
||||||
case conf.openThreadTab:
|
case conf.openThreadTab:
|
||||||
keybinds.open(thread, true);
|
keybinds.open(thread, true);
|
||||||
break;
|
break;
|
||||||
case conf.previousThread:
|
case conf.previousThread:
|
||||||
nav.prev();
|
if (g.REPLY) return;
|
||||||
|
nav.scroll(-1);
|
||||||
break;
|
break;
|
||||||
case conf.update:
|
case conf.update:
|
||||||
updater.update();
|
updater.update();
|
||||||
@ -1160,10 +1162,18 @@
|
|||||||
return $.add(d.body, span);
|
return $.add(d.body, span);
|
||||||
},
|
},
|
||||||
prev: function() {
|
prev: function() {
|
||||||
return nav.scroll(-1);
|
if (g.REPLY) {
|
||||||
|
return window.scrollTo(0, 0);
|
||||||
|
} else {
|
||||||
|
return nav.scroll(-1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
next: function() {
|
next: function() {
|
||||||
return nav.scroll(+1);
|
if (g.REPLY) {
|
||||||
|
return window.scrollTo(0, d.body.scrollHeight);
|
||||||
|
} else {
|
||||||
|
return nav.scroll(+1);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
threads: [],
|
threads: [],
|
||||||
getThread: function(full) {
|
getThread: function(full) {
|
||||||
@ -1182,37 +1192,13 @@
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
scroll: function(delta) {
|
scroll: function(delta) {
|
||||||
var i, rect, thread, top, _ref;
|
var i, rect, thread, top, _ref, _ref2;
|
||||||
if (g.REPLY) {
|
|
||||||
if (delta === -1) {
|
|
||||||
window.scrollTo(0, 0);
|
|
||||||
} else {
|
|
||||||
window.scrollTo(0, d.body.scrollHeight);
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
_ref = nav.getThread(true), thread = _ref[0], i = _ref[1], rect = _ref[2];
|
_ref = nav.getThread(true), thread = _ref[0], i = _ref[1], rect = _ref[2];
|
||||||
top = rect.top;
|
top = rect.top;
|
||||||
if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) {
|
if (!((delta === -1 && Math.ceil(top) < 0) || (delta === +1 && top > 1))) {
|
||||||
i += delta;
|
i += delta;
|
||||||
}
|
}
|
||||||
if (i === -1) {
|
top = (_ref2 = nav.threads[i]) != null ? _ref2.getBoundingClientRect().top : void 0;
|
||||||
if (g.PAGENUM === 0) {
|
|
||||||
window.scrollTo(0, 0);
|
|
||||||
} else {
|
|
||||||
window.location = "" + (g.PAGENUM - 1) + "#0";
|
|
||||||
}
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (delta === +1) {
|
|
||||||
if (i === nav.threads.length || (innerHeight + pageYOffset === d.body.scrollHeight)) {
|
|
||||||
if ($('table.pages input[value="Next"]')) {
|
|
||||||
window.location = "" + (g.PAGENUM + 1) + "#0";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
top = nav.threads[i].getBoundingClientRect().top;
|
|
||||||
return window.scrollBy(0, top);
|
return window.scrollBy(0, top);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
master
|
master
|
||||||
|
- Mayhem
|
||||||
|
Index Navigation and the See next/previous thread keybinds will not cycle through board pages anymore.
|
||||||
|
|
||||||
2.24.4
|
2.24.4
|
||||||
- ahokadesuka
|
- ahokadesuka
|
||||||
|
|||||||
@ -692,11 +692,13 @@ keybinds =
|
|||||||
when conf.expandImages
|
when conf.expandImages
|
||||||
keybinds.img thread
|
keybinds.img thread
|
||||||
when conf.nextThread
|
when conf.nextThread
|
||||||
nav.next()
|
return if g.REPLY
|
||||||
|
nav.scroll +1
|
||||||
when conf.openThreadTab
|
when conf.openThreadTab
|
||||||
keybinds.open thread, true
|
keybinds.open thread, true
|
||||||
when conf.previousThread
|
when conf.previousThread
|
||||||
nav.prev()
|
return if g.REPLY
|
||||||
|
nav.scroll -1
|
||||||
when conf.update
|
when conf.update
|
||||||
updater.update()
|
updater.update()
|
||||||
when conf.watch
|
when conf.watch
|
||||||
@ -828,10 +830,16 @@ nav =
|
|||||||
$.add d.body, span
|
$.add d.body, span
|
||||||
|
|
||||||
prev: ->
|
prev: ->
|
||||||
nav.scroll -1
|
if g.REPLY
|
||||||
|
window.scrollTo 0, 0
|
||||||
|
else
|
||||||
|
nav.scroll -1
|
||||||
|
|
||||||
next: ->
|
next: ->
|
||||||
nav.scroll +1
|
if g.REPLY
|
||||||
|
window.scrollTo 0, d.body.scrollHeight
|
||||||
|
else
|
||||||
|
nav.scroll +1
|
||||||
|
|
||||||
threads: []
|
threads: []
|
||||||
|
|
||||||
@ -847,13 +855,6 @@ nav =
|
|||||||
return null
|
return null
|
||||||
|
|
||||||
scroll: (delta) ->
|
scroll: (delta) ->
|
||||||
if g.REPLY
|
|
||||||
if delta is -1
|
|
||||||
window.scrollTo 0,0
|
|
||||||
else
|
|
||||||
window.scrollTo 0, d.body.scrollHeight
|
|
||||||
return
|
|
||||||
|
|
||||||
[thread, i, rect] = nav.getThread true
|
[thread, i, rect] = nav.getThread true
|
||||||
{top} = rect
|
{top} = rect
|
||||||
|
|
||||||
@ -863,22 +864,7 @@ nav =
|
|||||||
unless (delta is -1 and Math.ceil(top) < 0) or (delta is +1 and top > 1)
|
unless (delta is -1 and Math.ceil(top) < 0) or (delta is +1 and top > 1)
|
||||||
i += delta
|
i += delta
|
||||||
|
|
||||||
if i is -1
|
{top} = nav.threads[i]?.getBoundingClientRect()
|
||||||
if g.PAGENUM is 0
|
|
||||||
window.scrollTo 0, 0
|
|
||||||
else
|
|
||||||
window.location = "#{g.PAGENUM - 1}#0"
|
|
||||||
return
|
|
||||||
if delta is +1
|
|
||||||
# if we're at the last thread, or we're at the bottom of the page.
|
|
||||||
# kind of hackish, what we really need to do is make nav.getThread smarter.
|
|
||||||
if i is nav.threads.length or (innerHeight + pageYOffset == d.body.scrollHeight)
|
|
||||||
if $ 'table.pages input[value="Next"]'
|
|
||||||
window.location = "#{g.PAGENUM + 1}#0"
|
|
||||||
return
|
|
||||||
#TODO sfx
|
|
||||||
|
|
||||||
{top} = nav.threads[i].getBoundingClientRect()
|
|
||||||
window.scrollBy 0, top
|
window.scrollBy 0, top
|
||||||
|
|
||||||
options =
|
options =
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user