Customise preview window height and width

Last post 08-23-2013, 3:32 PM by rezagc. 4 replies.
Sort Posts: Previous Next
  •  08-23-2013, 11:52 AM 77895

    Customise preview window height and width

    Hi there,

     

    Is there any way that I can customise the Preview window height and width?

    Right now when you open preview the default hight/width are 518 and 632. I want that be always set to 650/450.

     

    Thanks, 

     

                

    Filed under:
  •  08-23-2013, 1:33 PM 77896 in reply to 77895

    Re: Customise preview window height and width

    Hi rezagc,

     

    You can change the editor height dynamically when the user switch to preview. The example below shows you how to achieve it.

     

    1. <%@ Page Language="C#" %>  
    2.   
    3. <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>  
    4. <html>  
    5. <head>  
    6.     <title>example </title>  
    7. </head>  
    8. <body>  
    9.     <form id="Form1" runat="server">  
    10.         <CE:Editor ID="Editor1" runat="server" Height="500">  
    11.         </CE:Editor>  
    12.     </form>  
    13. </body>  
    14. </html>  
    15.   
    16. <script>  
    17. function changeHeight(custom_height)  
    18. {  
    19.     var editor1=document.getElementById("<%= Editor1.ClientID %>");  
    20.     editor1.SetHeight(custom_height);  
    21. }  
    22. function CuteEditor_OnCommand(editor,command,ui,value)  
    23.  {  
    24.     if(command=="TabView")  
    25.     {  
    26.         setTimeout("changeHeight(650)",200);  
    27.     }  
    28.     if(command=="TabCode"||command=="TabEdit")  
    29.     {  
    30.         setTimeout("changeHeight(500)",200);  
    31.     }  
    32. }  
    33. </script>  
     

    Regards,

     

    Ken 

  •  08-23-2013, 1:49 PM 77898 in reply to 77896

    Re: Customise preview window height and width

    Hi Ken,

     

    Thanks for your help but that din change the Preview window size.

    I added the javascript you send to my page but no difference. I added an alert in function CuteEditor_OnCommand(editor,command,ui,value) but it din fire the alert at all.

     

    Right now  this is what I see

     

     

    But I want the Preview window always opens to the Width and Height I want.

    Is there any way around this?

     

    Thanks,

     

    Reza 

  •  08-23-2013, 2:31 PM 77899 in reply to 77898

    Re: Customise preview window height and width

    Hi rezagc,

     

    You can ignore the code I sent before. I thought you talking about the bottom bar menu "preview".

     

    If you want to change the size of the preview dialog, please try the way below.

     

    1. Open file  \CuteSoft_Client\CuteEditor\Scripts\Constant.js

     

    2. Find section below. You can change the widht and hieght directly. 

     

    editorconstant._previewDialogFeature = "dialogWidth:640px;dialogHeight:480px;resizable:1"; 

     

    Regards,

     

    Ken 

  •  08-23-2013, 3:32 PM 77900 in reply to 77899

    Re: Customise preview window height and width

    Thanks Ken,

     

    That is what I was looking for.

     

    Cheers,

     

    Reza 

View as RSS news feed in XML