This is a migrated thread and some comments may be shown as answers.

Images always go at the top of the content placeholder

3 Answers 39 Views
WebParts for SharePoint
This is a migrated thread and some comments may be shown as answers.
Lars Nielsen
Top achievements
Rank 1
Lars Nielsen asked on 21 Jan 2010, 11:49 AM
We've found when we use the image manager to add an image into the content placeholder in the middle of other text, the image is always inserted at the top of the HTML, and you have to drag it down manually to the correct place.  Is this standard behaviour - is there any way to get the images to insert at the cursor position rather than right at the top?

3 Answers, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 25 Jan 2010, 10:25 AM
Hi Lars,
In order to fix the problem add the following javascript to the end of the MOSSEditorTools.js file, which is located in the Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\4.5.6.0__1f131a624888eeed\RadControls\Editor\Scripts\7_3_6 folder.
RadEditor.prototype.GetSelectedElement = function()
{
    //fixes a problem in IE 8 where the image dialog inserts images only at the beginning of the content
    if (window.RadControlsNamespace.Browser.IsIE && document.documentMode) this.SetFocus();
 
    return this.GetSelection().GetParentElement();
};


Best wishes,
Stanimir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Lars Nielsen
Top achievements
Rank 1
answered on 25 Jan 2010, 10:37 AM
Hi Stanimir,

That works well, thanks very much. 

We have the same problem with tables as well - when you insert a table using the table wizard, at the cursor position it jumps to the top.  Is there a fix for tables as well?

Cheers
0
Stanimir
Telerik team
answered on 26 Jan 2010, 11:02 AM
Hello Lars Nielsen,

Here is the javascript code, which you can use.
var originalTableWizardCall = RadEditorCommandList[RadEditorNamespace.RADCOMMAND_TABLE_WIZARD];
RadEditorCommandList[RadEditorNamespace.RADCOMMAND_TABLE_WIZARD] = function (commandName, editor, oTool)
{
    //fixes a problem in IE 8 where the table inserts only at the beginning of the content
    if (window.RadControlsNamespace.Browser.IsIE && document.documentMode) editor.SetFocus();
    //call the original function
    originalTableWizardCall(commandName, editor, oTool);
}



Sincerely yours,
Stanimir
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
WebParts for SharePoint
Asked by
Lars Nielsen
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Lars Nielsen
Top achievements
Rank 1
Share this question
or