From 9a923e3b98a545ed2cd006b5b67237c359cb0750 Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Fri, 6 Jun 2014 21:36:55 +1000 Subject: [PATCH] Add fullpage option to richeditor --- .../richeditor/assets/js/richeditor.js | 19 +++++++++++++++---- .../richeditor/partials/_richeditor.htm | 3 ++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/modules/backend/formwidgets/richeditor/assets/js/richeditor.js b/modules/backend/formwidgets/richeditor/assets/js/richeditor.js index dc0a7f792..6339118fc 100644 --- a/modules/backend/formwidgets/richeditor/assets/js/richeditor.js +++ b/modules/backend/formwidgets/richeditor/assets/js/richeditor.js @@ -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 diff --git a/modules/backend/formwidgets/richeditor/partials/_richeditor.htm b/modules/backend/formwidgets/richeditor/partials/_richeditor.htm index 7dd506109..302b2378a 100644 --- a/modules/backend/formwidgets/richeditor/partials/_richeditor.htm +++ b/modules/backend/formwidgets/richeditor/partials/_richeditor.htm @@ -4,7 +4,8 @@
data-fullpage="true" data-control="richeditor">