diff --git a/modules/backend/formwidgets/richeditor/assets/js/build-min.js b/modules/backend/formwidgets/richeditor/assets/js/build-min.js index fc1dc78fe..9a61b6a3d 100755 --- a/modules/backend/formwidgets/richeditor/assets/js/build-min.js +++ b/modules/backend/formwidgets/richeditor/assets/js/build-min.js @@ -545,6 +545,7 @@ RichEditor.prototype.build=function(event,editor){this.updateLayout() $(window).on('resize',this.proxy(this.updateLayout)) $(window).on('oc.updateUi',this.proxy(this.updateLayout)) this.$textarea.trigger('init.oc.richeditor',[this])} +RichEditor.prototype.isCodeViewActive=function(){return this.editor&&this.editor.codeView&&this.editor.codeView.isActive()} RichEditor.prototype.getElement=function(){return this.$el} RichEditor.prototype.getEditor=function(){return this.editor} RichEditor.prototype.getTextarea=function(){return this.$textarea} @@ -576,7 +577,7 @@ RichEditor.prototype.onKeydown=function(ev,editor,keyEv){this.$textarea.trigger( if(ev.isDefaultPrevented()){return false}} RichEditor.prototype.onChange=function(ev){this.$form.trigger('change')} RichEditor.prototype.onFormBeforeRequest=function(ev){if(!this.editor){return} -if(this.editor.codeView&&this.editor.codeView.isActive()){this.editor.html.set(this.editor.codeView.get())} +if(this.isCodeViewActive()){this.editor.html.set(this.editor.codeView.get())} this.$textarea.val(this.editor.html.get())} var old=$.fn.richEditor $.fn.richEditor=function(option){var args=Array.prototype.slice.call(arguments,1),result diff --git a/modules/backend/formwidgets/richeditor/assets/js/richeditor.js b/modules/backend/formwidgets/richeditor/assets/js/richeditor.js index 5128a2c85..ac7cf80ea 100755 --- a/modules/backend/formwidgets/richeditor/assets/js/richeditor.js +++ b/modules/backend/formwidgets/richeditor/assets/js/richeditor.js @@ -218,6 +218,10 @@ this.$textarea.trigger('init.oc.richeditor', [this]) } + RichEditor.prototype.isCodeViewActive = function() { + return this.editor && this.editor.codeView && this.editor.codeView.isActive() + } + RichEditor.prototype.getElement = function() { return this.$el } @@ -343,7 +347,7 @@ return } - if (this.editor.codeView && this.editor.codeView.isActive()) { + if (this.isCodeViewActive()) { this.editor.html.set(this.editor.codeView.get()) } diff --git a/modules/system/assets/ui/storm-min.js b/modules/system/assets/ui/storm-min.js index cd423ce3a..49145a84c 100644 --- a/modules/system/assets/ui/storm-min.js +++ b/modules/system/assets/ui/storm-min.js @@ -3185,7 +3185,7 @@ extraOptions.closeOnSelect=false $element.on('select2:closing',function(){$('.select2-dropdown.select-no-dropdown:first .select2-results__option--highlighted').removeClass('select2-results__option--highlighted') $('.select2-dropdown.select-no-dropdown:first .select2-results__option:first').addClass('select2-results__option--highlighted')})}} var placeholder=$element.data('placeholder') -if(placeholder){extraOptions.placeholder=placeholder;} +if(placeholder){extraOptions.placeholder=placeholder} $element.select2($.extend({},selectOptions,extraOptions))})}) $(document).on('disable','select.custom-select',function(event,status){if($(this).data('select2')!=null){$(this).select2('enable',!status)}})})(jQuery);+function($){"use strict";var LoadIndicator=function(element,options){this.$el=$(element) this.options=options||{}