Images always go at the top of the content placeholder

4 posts, 0 answers
  1. Lars Nielsen
    Lars Nielsen avatar
    5 posts
    Member since:
    Jul 2009

    Posted 21 Jan 2010 Link to this post

    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?
  2. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 25 Jan 2010 Link to this post

    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.

  3. Lars Nielsen
    Lars Nielsen avatar
    5 posts
    Member since:
    Jul 2009

    Posted 25 Jan 2010 Link to this post

    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
  4. Stanimir
    Admin
    Stanimir avatar
    1653 posts

    Posted 26 Jan 2010 Link to this post

    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.
Back to Top