Only cycle through stream elements when cycling through streams

(imported from commit 244d72e88e18cc49f32ecfada791f032140390f2)
This commit is contained in:
Leo Franchi 2014-02-28 16:48:45 -05:00
parent ba0d3605ae
commit de9d26126a
1 changed files with 6 additions and 6 deletions

View File

@ -78,21 +78,21 @@ exports.cycle_stream = function (direction) {
switch (direction) {
case 'forward':
if (narrow.stream() === undefined) {
nextStream = $("#stream_filters").children().first();
nextStream = $("#stream_filters").children('.narrow-filter').first();
} else {
nextStream = currentStream.next();
nextStream = currentStream.next('.narrow-filter');
if (nextStream.length === 0) {
nextStream = $("#stream_filters").children().first();
nextStream = $("#stream_filters").children('.narrow-filter').first();
}
}
break;
case 'backward':
if (narrow.stream() === undefined) {
nextStream = $("#stream_filters").children().last();
nextStream = $("#stream_filters").children('.narrow-filter').last();
} else {
nextStream = currentStream.prev();
nextStream = currentStream.prev('.narrow-filter');
if (nextStream.length === 0) {
nextStream = $("#stream_filters").children().last();
nextStream = $("#stream_filters").children('.narrow-filter').last();
}
}
break;