Expose isCodeViewActive API function

Recompile JS
This commit is contained in:
Samuel Georges 2016-11-12 14:12:48 +11:00
parent 0bcf8f47c1
commit a2a0b207c6
3 changed files with 8 additions and 3 deletions

View File

@ -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

View File

@ -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())
}

View File

@ -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||{}