Ctrl/Cmd+S should work inside Redactor

This commit is contained in:
Sam Georges 2014-08-22 21:47:22 +10:00
parent 4db38b1650
commit 3c8f3cdb3f
1 changed files with 18 additions and 3 deletions

View File

@ -61,12 +61,27 @@
}
RichEditor.prototype.build = function() {
if (this.$el.hasClass('stretch')) {
var $iframe = $('iframe', this.$el),
$toolbar = $('.redactor_toolbar', this.$el)
var $iframe = this.$textarea.redactor('getIframe'),
$toolbar = this.$textarea.redactor('getToolbar'),
$html = $('html')
if (!$iframe)
return
if (this.$el.hasClass('stretch')) {
$iframe.css('padding-top', $toolbar.height())
}
/*
* Replicate hotkeys to parent container
*/
$iframe.contents().find('html').on('keydown', function(event){
$html.triggerHandler(event)
})
$iframe.contents().find('html').on('keyup', function(event){
$html.triggerHandler(event)
})
}
// RICHEDITOR PLUGIN DEFINITION