4 Answers, 1 is accepted
0
Hi Fabian,
You can achieve your goal when the ToolbarMode is set to ShowOnFocus using the following code:
Best regards,
Rumen
the Telerik team
You can achieve your goal when the ToolbarMode is set to ShowOnFocus using the following code:
<telerik:RadEditor runat=
"server"
ID=
"RadEditor1"
ToolbarMode=
"ShowOnFocus"
OnClientLoad=
"OnClientLoad"
>
</telerik:RadEditor>
<script type=
"text/javascript"
>
function
OnClientLoad(editor) {
var
wnd = editor.get_toolAdapter().get_window();
wnd.add_show(
function
(sender, args) {
//Get last toolbar and return to old owner
//Move window
setTimeout(
function
() {
wnd.moveTo(100, 100);
$telerik.cancelRawEvent(args);
}, 10);
});
}
</script>
Best regards,
Rumen
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
fabian
Top achievements
Rank 1
answered on 02 Mar 2011, 02:36 PM
Hello,
thank you for the reply.
That wouldn't work because when you scroll down the tool bar doesn't move down like 'PageTop' does.
Any other suggestions?
thank you
thank you for the reply.
That wouldn't work because when you scroll down the tool bar doesn't move down like 'PageTop' does.
Any other suggestions?
thank you
0
fabian
Top achievements
Rank 1
answered on 02 Mar 2011, 03:13 PM
Hello this seems work:
but I have a problem with FireFox, the drop down menus from the tool bar don't show in the right position using this css style. Any suggestions?
I have this same problem with a rad tool bar inside a div using position:fixed
Please see attachment.
thank you
.reToolbarWindow
{
position: fixed !important;
top:31px !important;
left: 50% !important;
width:900px !important;
margin-left: -450px !important;
}
I have this same problem with a rad tool bar inside a div using position:fixed
Please see attachment.
thank you
0
Hi Fabian,
This is expected behavior with the applied modifications. By design, the dropdowns of RadEditor's toolbar calculate their position according the the position of the toolbar and by design the toolbar is absolute positioned and its top property is modified in order to position the toolbar on the top of the browser's window.
To achieve the required result, you can set RadEditor's ToolbarMode property to ShowOnTop and manually position the toolbar with the required padding, e.g.:
I hope this helps.
Best wishes,
Dobromir
the Telerik team
This is expected behavior with the applied modifications. By design, the dropdowns of RadEditor's toolbar calculate their position according the the position of the toolbar and by design the toolbar is absolute positioned and its top property is modified in order to position the toolbar on the top of the browser's window.
To achieve the required result, you can set RadEditor's ToolbarMode property to ShowOnTop and manually position the toolbar with the required padding, e.g.:
<telerik:RadEditor runat=
"server"
ID=
"RadEditor1"
ToolbarMode=
"ShowOnFocus"
OnClientLoad=
"OnClientLoad"
>
</telerik:RadEditor>
<script type=
"text/javascript"
>
function
OnClientLoad(editor, args)
{
var
interval =
null
;
var
wnd = editor.get_toolAdapter().get_window();
wnd.add_show(
function
(sender, args)
{
interval = window.setInterval(positionToolbar, 100);
});
function
positionToolbar()
{
if
(wnd.get_popupElement().style.display !=
"none"
)
{
var
scrollTop = document.body.scrollTop;
if
(scrollTop == 0)
{
if
(window.pageYOffset)
scrollTop = window.pageYOffset;
else
scrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
}
var
x = 0;
var
y = scrollTop + 20;
//20px padding from the top
wnd.get_popupElement().style.width =
""
;
wnd.moveTo(x, y);
}
else
{
window.clearInterval(interval);
}
}
}
</script>
I hope this helps.
Best wishes,
Dobromir
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!