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

Popup window in Editor adding iframe.

1 Answer 92 Views
Editor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
PauloAbreu
Top achievements
Rank 1
PauloAbreu asked on 17 Jun 2011, 09:30 PM
I've downloaded 2011.1.324 version from a telerik post after a bug correction.

In Editor telerik examples, I selected custom tools option and copied the example code for showHtml popup window.

For some reason, this window is adding an iframe in the popup windows, as you can see in attached image.

Am I doing something wrong?

Thanks,

Paulo Abreu
<script type="text/javascript">
    var htmlSourcePopup;
 
    function viewSource(e) {
        e = $.Event(e);
 
        e.stopPropagation();
        e.preventDefault();
 
        var editor = $('#Editor').data('tEditor');
        var html = editor.value();
 
        if (!htmlSourcePopup) {
            htmlSourcePopup =
                $('<div class="html-view">' +
                '<div class="textarea t-state-default"><textarea></textarea></div>' +
                '<div class="t-button-wrapper">' +
                '<button id="htmlCancel" class="t-button">Cancel</button>' +
                '<button id="htmlUpdate" class="t-button">Update</button>' +
                '</div>' +
                '</div>')
                    .css('display', 'none')
                    .tWindow({
                    title: 'HTML',
                    modal: true,
                    resizable: false,
                    draggable: true,
                    width: 700,
                    onLoad: function() {
                        var $popup = $(this);
                        $popup.find('.textarea')
                                        .css('width', function() {
                                            return 700 - (this.offsetWidth - $(this).width());
                                        })
                                        .focus()
                                        .end()
                                        .find('#htmlCancel')
                                        .click(function() {
                                    htmlSourcePopup.close();
                                })
                                        .end()
                                        .find('#htmlUpdate')
                                        .click(function() {
                                    var value = $popup.find('textarea').val();
                                    editor.value(value);
                                    htmlSourcePopup.close();
                                });
                    },
                    onClose: function() {
                        editor.focus();
                    },
                    effects: $.telerik.fx.toggle.defaults()
                })
                    .data('tWindow');
        }
 
        $(htmlSourcePopup.element).find('textarea').text(html);
 
        htmlSourcePopup.center().open();
    }
    @* attach handler for html viewer *@
    @{ Html.Telerik().ScriptRegistrar().OnDocumentReady(@<text>
            $('.t-html').click(showHtml);
     </text>); }
</script>
@section Header {
    <style type="text/css">
        .t-editor .t-html
        {
            background-image: url('@Url.Content("~/Content/Editor/insert-html-icon.png") ');
        }
         
        .html-view .t-button-wrapper
        {
            padding: .5em 0;           
        }
         
        #htmlCancel
        {
            float: right;
        }
         
        .textarea
        {
            border-width: 1px;
            border-style: solid;
        }
         
        .textarea textarea
        {
             margin: 0;
             padding: 0;
             border: 0;
             font: normal 12px Consolas,Courier New,monospace;
             width: 100%;
             height: 300px;
        }
    </style>
}

1 Answer, 1 is accepted

Sort by
0
PauloAbreu
Top achievements
Rank 1
answered on 02 Jul 2011, 04:22 PM
I've downloaded Q2 2011 Beta (2011.2.629) and the problem no longer exists.
Tags
Editor
Asked by
PauloAbreu
Top achievements
Rank 1
Answers by
PauloAbreu
Top achievements
Rank 1
Share this question
or