Fixes the source editor in the Redactor.

This commit is contained in:
alekseybobkov 2014-09-04 20:17:29 -07:00
parent 60d8e71804
commit b69f7b649e
3 changed files with 8 additions and 7 deletions

View File

@ -65,7 +65,8 @@
top: 32px;
background-color: #e0e0e0;
}
.field-richeditor.stretch .redactor_box iframe {
.field-richeditor.stretch .redactor_box iframe,
.field-richeditor.stretch .redactor_box textarea {
display: block;
position: absolute;
height: 100%!important;

View File

@ -63,25 +63,25 @@
}
RichEditor.prototype.build = function() {
var $iframe = $('iframe', this.$el),
var $editors = $('iframe, textarea', this.$el),
$toolbar = $('.redactor_toolbar', this.$el),
$html = $('html')
if (!$iframe.length)
if (!$editors.length)
return
if (this.$el.hasClass('stretch')) {
$iframe.css('padding-top', $toolbar.height())
$editors.css('padding-top', $toolbar.height())
}
/*
* Replicate hotkeys to parent container
*/
$iframe.contents().find('html').on('keydown', function(event){
$editors.contents().find('html').on('keydown', function(event){
$html.triggerHandler(event)
})
$iframe.contents().find('html').on('keyup', function(event){
$editors.contents().find('html').on('keyup', function(event){
$html.triggerHandler(event)
})
}

View File

@ -58,7 +58,7 @@
}
}
iframe {
iframe, textarea {
display: block;
position: absolute;
height: 100%!important;