Changeset View
Standalone View
core/admin_templates/incs/footer.tpl
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | |||||
<inp2:adm_AfterScript/> | <inp2:adm_AfterScript/> | ||||
<inp2:m_ifnot check="m_Param" name="noform" equals_to="yes"> | <inp2:m_ifnot check="m_Param" name="noform" equals_to="yes"> | ||||
<inp2:m_RenderElement name="kernel_form_end"/> | <inp2:m_RenderElement name="kernel_form_end"/> | ||||
</inp2:m_ifnot> | </inp2:m_ifnot> | ||||
<div id="nlsMenuPlace"></div> | <div id="nlsMenuPlace"></div> | ||||
<inp2:m_if check="m_Get" name="edit_field"> | |||||
<script type="text/javascript"> | |||||
<inp2:m_if check="adm_UsePopups"> | |||||
Application.setHook('m:OnAfterFormInit', function () { | |||||
var $row = get_control('<inp2:adm_PassedPrefixTag tag="InputName" name="#FIELD_NAME#" js_escape="1"/>', '<inp2:m_Get name="edit_field" js_escape="1"/>', 'row'); | |||||
$('#scroll_container_container').scrollTop($($row).offset().top - $('#scroll_container_container').offset().top); | |||||
}); | |||||
<inp2:m_else/> | |||||
$(document).ready(function () { | |||||
var $row = get_control('<inp2:adm_PassedPrefixTag tag="InputName" name="#FIELD_NAME#" js_escape="1"/>', '<inp2:m_Get name="edit_field" js_escape="1"/>', 'row'); | |||||
$(getFrame('main').document).scrollTop($($row).offset().top); | |||||
}); | |||||
</inp2:m_if> | |||||
</script> | |||||
</inp2:m_if> | |||||
</body> | </body> | ||||
</html> | </html> | ||||
alex: Element query code & IF statement needs to be placed inside hook code.
---
The `m… | |||||
Not Done ReplyIt appears, that this change wasn't done in 377 diff. alex: It appears, that this change wasn't done in 377 diff. | |||||
Not Done Reply
alex: # replace `parent.frames['main']` with `getFrame('main')`
# use same `scrollTop` method, but… | |||||
Not Done ReplyscrollTop on the document object not always working - this solution is not cross-browser. erik: scrollTop on the document object not always working - this solution is not cross-browser. | |||||
Not Done ReplyCan you please be more specific about browsers, where this doesn't work? On both Chrome and Firefox I did this:
window.frames['main'].$(window.frames['main'].document).scrollTop(10);
alex: Can you please be more specific about browsers, where this doesn't work?
---
On both Chrome… | |||||
Not Done ReplyYes, it works. Seems, i used some wrong approach when trying scrollTop. I do not remember what code was tried before scrollBy solution. erik: Yes, it works. Seems, i used some wrong approach when trying scrollTop. I do not remember what… | |||||
Not Done ReplyIt appears, that this change wasn't done in 377 diff. alex: It appears, that this change wasn't done in 377 diff. | |||||
Not Done ReplyPlease replace with: var $row = get_control('<inp2:$prefix_InputName name="#FIELD_NAME#" js_escape="1"/>', '<inp2:m_Get name="edit_field"/>', 'row'); See comment related to PassedPrefixTag declaration. alex: Please replace with:
```
lang=js
var $row = get_control('<inp2:$prefix_InputName… | |||||
Not Done ReplyDecided not to do this. alex: Decided not to do this. | |||||
Not Done ReplyMove all this code at the end of form_error_warning block definition. The prefix block parameter available in form_error_warning block would allow to universally identify edited unit. alex: Move all this code at the end of `form_error_warning` block definition.
---
The `prefix`… | |||||
Not Done ReplyAfter discussing over Skype decided not to do this, because the form_error_warning block is only shown when there is an error on the form. alex: After discussing over Skype decided not to do this, because the `form_error_warning` block is… | |||||
Not Done ReplyPlease also add js_escape="1" to the m_Get tag call. alex: Please also add `js_escape="1"` to the `m_Get` tag call. | |||||
Not Done ReplyPlease also add js_escape="1" to the m_Get tag call. alex: Please also add `js_escape="1"` to the `m_Get` tag call. | |||||
Not Done ReplyPlease move JavaScript code block up in the DOM tree to be last node inside <body> tag. Having JavaScript code after </html> tag isn't guaranteed to work in all Web Browsers. alex: Please move JavaScript code block up in the DOM tree to be last node inside `<body>` tag. | |||||
No newline at end of file |
Element query code & IF statement needs to be placed inside hook code.
The m:OnAfterFormInit hook is called after Form class wraps elements in <div id="scroll_container"> DIV in another DIV used for scrolling. Nature of wrapping operation is performing copy/paste of elements in that DIV and reference to DOM element stored in $row variable would point to different element at that point.