This question is locked. New answers and comments are not allowed.
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
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
>
}