mirror of
https://github.com/wintercms/winter.git
synced 2024-06-28 05:33:29 +02:00
Add fullpage option to richeditor
This commit is contained in:
parent
4550f947f9
commit
9a923e3b98
@ -25,6 +25,8 @@
|
||||
}
|
||||
|
||||
RichEditor.DEFAULTS = {
|
||||
stylesheet: null,
|
||||
fullpage: false
|
||||
}
|
||||
|
||||
RichEditor.prototype.init = function (){
|
||||
@ -40,12 +42,21 @@
|
||||
/*
|
||||
* Initialize Redactor editor
|
||||
*/
|
||||
this.$textarea.redactor({
|
||||
iframe: true,
|
||||
css: this.options.iframeCss,
|
||||
var redactorOptions = {
|
||||
focusCallback: function() { self.$el.addClass('editor-focus') },
|
||||
blurCallback: function() { self.$el.removeClass('editor-focus') }
|
||||
});
|
||||
}
|
||||
|
||||
if (this.options.stylesheet) {
|
||||
redactorOptions.iframe = true
|
||||
redactorOptions.css = this.options.stylesheet
|
||||
}
|
||||
|
||||
if (this.options.fullpage) {
|
||||
redactorOptions.fullpage = true
|
||||
}
|
||||
|
||||
this.$textarea.redactor(redactorOptions)
|
||||
}
|
||||
|
||||
// RICHEDITOR PLUGIN DEFINITION
|
||||
|
@ -4,7 +4,8 @@
|
||||
<div
|
||||
id="<?= $this->getId() ?>"
|
||||
class="field-richeditor size-<?= $size ?> <?= $stretch?'layout-item stretch':'' ?>"
|
||||
data-iframe-css="<?= URL::to('/modules/backend/formwidgets/richeditor/assets/css/iframe.css') ?>"
|
||||
data-stylesheet="<?= URL::to('/modules/backend/formwidgets/richeditor/assets/css/iframe.css') ?>"
|
||||
<?php if ($fullPage): ?>data-fullpage="true"<?php endif ?>
|
||||
data-control="richeditor">
|
||||
<textarea name="<?= $name ?>" id="<?= $this->getId('textarea') ?>"><?= e($value) ?></textarea>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user