To allow scrolling in Safari mobile, we set the content of text_view_comments frame in a jQuery UI layout.
So the automated scrolling operations in c_sync.js must be adjustable to the right part to scroll.
Also, if a comment have to be shown outside of the current viewport, we scroll the correct part to that viewport
and then set the comment top Y offset to juste what it needs to avoid the "Add comment" button after scrolling
operation.
If not in Safari mobile, we add an offset here to avoid comment to display under the "Add comment" button.
[
{
"fields": {
"adminkey": "keyAdmin",
"created": "2009-02-13 03:27:05",
"key": "keyText",
"modified": "2009-02-13 03:27:05",
"last_text_version": null,
"state":"approved",
"title": "1top level title"
},
"model": "cm.text",
"pk": 1
},
{
"fields": {
"name": "author",
"content": "simple text <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p> <p>simple text</p>",
"created": "2009-02-13 03:27:05",
"format": "html",
"key": "keyTextVersion",
"modified": "2009-02-13 03:27:05",
"note": "ma note",
"text": 1,
"title": "1top level title"
},
"model": "cm.textversion",
"pk": 1
},
{
"fields": {
"name": "author",
"content": "comment content 1",
"created": "2009-02-13 04:00:24",
"end_wrapper": 15,
"modified": "2009-02-13 04:00:24",
"reply_to": null,
"start_wrapper": 5,
"text_version": 1,"start_offset":2,"end_offset":6,
"title": "3top level title",
"adminkey": "keyAdminc3",
"key": "keyc3",
"state": "approved"
},
"model": "cm.comment",
"pk": 3
},
{
"fields": {
"name": "author",
"content": "comment content 2",
"created": "2009-02-13 04:00:29",
"end_wrapper": 13,
"modified": "2009-02-13 04:00:29",
"reply_to": null,
"start_wrapper": 1,
"text_version": 1,"start_offset":0,"end_offset":0,
"title": "4top level title",
"adminkey": "keyAdminc4",
"key": "keyc4",
"state": "approved"
},
"model": "cm.comment",
"pk": 4
},
{
"fields": {
"name": "author",
"content": "comment content 3",
"created": "2009-02-13 04:01:12",
"end_wrapper": null,
"modified": "2009-02-13 04:01:12",
"reply_to": 4,
"start_wrapper": null,
"text_version": 1,"start_offset":null,"end_offset":null,
"title": "6(4) child level title",
"adminkey": "keyAdminc6",
"key": "keyc6",
"state": "approved"
},
"model": "cm.comment",
"pk": 6
},
{
"fields": {
"name": "author2",
"content": "comment content 4",
"created": "2009-02-13 04:01:12",
"end_wrapper": null,
"modified": "2009-02-13 04:01:12",
"reply_to": 4,
"start_wrapper": null,
"text_version": 1,"start_offset":null,"end_offset":null,
"title": "7(4) child level title",
"adminkey": "keyAdminc7",
"key": "keyc7",
"state": "approved"
},
"model": "cm.comment",
"pk": 7
},
{
"fields": {
"name": "author2",
"content": "comment content 5",
"created": "2009-02-13 04:01:12",
"end_wrapper": null,
"modified": "2009-02-13 04:01:12",
"reply_to": 7,
"start_wrapper": null,
"text_version": 1,"start_offset":null,"end_offset":null,
"title": "8(7) child child level title",
"adminkey": "keyAdminc8",
"key": "keyc8",
"state": "approved"
},
"model": "cm.comment",
"pk": 8
},
{
"fields": {
"name": "author2",
"content": "comment content 6",
"created": "2009-02-13 04:01:12",
"end_wrapper": null,
"modified": "2009-02-13 04:01:12",
"reply_to": 8,
"start_wrapper": null,
"text_version": 1,"start_offset":null,"end_offset":null,
"title": "9(8) child child child level title",
"adminkey": "keyAdminc9",
"key": "keyc9",
"state": "approved"
},
"model": "cm.comment",
"pk": 9
},
{
"fields": {
"name": "author2",
"content": "comment content 7",
"created": "2009-02-13 04:01:12",
"end_wrapper": null,
"modified": "2009-02-13 04:01:12",
"reply_to": 3,
"start_wrapper": null,
"text_version": 1,"start_offset":null,"end_offset":null,
"title": "10(3) child level title",
"adminkey": "keyAdminc10",
"key": "keyc10",
"state": "approved"
},
"model": "cm.comment",
"pk": 10
},
{
"fields": {
"name": "author2",
"content": "comment content 7",
"created": "2009-02-13 04:01:12",
"end_wrapper": 1,
"modified": "2009-02-13 04:01:12",
"reply_to": null,
"start_wrapper": 1,
"text_version": 1,"start_offset":1,"end_offset":3,
"title": "10(3) child level title",
"adminkey": "keyAdminc11",
"key": "keyc11",
"state": "approved"
},
"model": "cm.comment",
"pk": 11
}
]