Skip to content

Commit 4709ebf

Browse files
committed
alternate fix for FFOS rating scroll (bug 874700)
1 parent aeab86b commit 4709ebf

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

hearth/media/js/views/app/ratings/add.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,14 @@ define('views/app/ratings/add',
2727
if (textarea) {
2828
textarea.focus();
2929
}
30+
if (scrollTo && !caps.widescreen()) {
31+
// Wait for the keyboard to shrink the window height.
32+
// Would be awesome if FFOS fired a `scrollbar appeared` event.
33+
setTimeout(function() {
34+
window.scrollTo(0, 200);
35+
}, 350);
36+
}
3037
});
31-
32-
if (scrollTo && !caps.widescreen()) {
33-
console.log('scrollTo');
34-
$reviewBox.find('textarea').on('focus', function() {
35-
console.log('focus');
36-
window.scrollTo(0, 200);
37-
});
38-
}
3938
});
4039

4140
builder.z('type', 'leaf');

hearth/media/js/views/app/ratings/edit.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ define('views/app/ratings/edit',
6262
if (textarea) {
6363
textarea.focus();
6464
}
65+
if (scrollTo && !caps.widescreen()) {
66+
// Wait for the keyboard to shrink the window height.
67+
// Would be awesome if FFOS fired a `scrollbar appeared` event.
68+
setTimeout(function() {
69+
window.scrollTo(0, 200);
70+
}, 350);
71+
}
6572
});
66-
67-
if (scrollTo && !caps.widescreen()) {
68-
$reviewBox.find('textarea').on('focus', function() {
69-
window.scrollTo(0, 200);
70-
});
71-
}
7273
});
7374

7475
// If we hit the API and find out that there's no review for the user,

0 commit comments

Comments
 (0)