mirror of
https://github.com/processwire/processwire.git
synced 2025-08-15 11:14:12 +02:00
Update InputfieldTinyMCE to add an 'InputfieldTinyMCEFocused' class to .Inputfield element when the TinyMCE input is focused
This commit is contained in:
@@ -120,6 +120,7 @@ var InputfieldTinyMCE = {
|
|||||||
inline: 'InputfieldTinyMCEInline',
|
inline: 'InputfieldTinyMCEInline',
|
||||||
normal: 'InputfieldTinyMCENormal',
|
normal: 'InputfieldTinyMCENormal',
|
||||||
loaded: 'InputfieldTinyMCELoaded',
|
loaded: 'InputfieldTinyMCELoaded',
|
||||||
|
focused: 'InputfieldTinyMCEFocused',
|
||||||
editor: 'InputfieldTinyMCEEditor',
|
editor: 'InputfieldTinyMCEEditor',
|
||||||
placeholder: 'InputfieldTinyMCEPlaceholder'
|
placeholder: 'InputfieldTinyMCEPlaceholder'
|
||||||
},
|
},
|
||||||
@@ -839,6 +840,7 @@ var InputfieldTinyMCE = {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
documentReady: function() {
|
documentReady: function() {
|
||||||
|
var t = this;
|
||||||
this.debug = ProcessWire.config.InputfieldTinyMCE.debug;
|
this.debug = ProcessWire.config.InputfieldTinyMCE.debug;
|
||||||
this.isDocumentReady = true;
|
this.isDocumentReady = true;
|
||||||
this.log('documentReady', this.editorIds);
|
this.log('documentReady', this.editorIds);
|
||||||
@@ -849,6 +851,16 @@ var InputfieldTinyMCE = {
|
|||||||
this.initDocumentEvents();
|
this.initDocumentEvents();
|
||||||
var $placeholders = jQuery('.' + this.cls.placeholder + ':visible');
|
var $placeholders = jQuery('.' + this.cls.placeholder + ':visible');
|
||||||
if($placeholders.length) this.initPlaceholders($placeholders);
|
if($placeholders.length) this.initPlaceholders($placeholders);
|
||||||
|
|
||||||
|
this.onSetup(function(editor) {
|
||||||
|
editor.on('focus', function(e) {
|
||||||
|
$(editor.container).closest('.' + t.cls.main).addClass(t.cls.focused);
|
||||||
|
});
|
||||||
|
editor.on('blur', function(e) {
|
||||||
|
$(editor.container).closest('.' + t.cls.main).removeClass(t.cls.focused);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
if(this.debug) {
|
if(this.debug) {
|
||||||
this.log('qty',
|
this.log('qty',
|
||||||
'normal=' + jQuery('.' + this.cls.normal).length + ', ' +
|
'normal=' + jQuery('.' + this.cls.normal).length + ', ' +
|
||||||
|
Reference in New Issue
Block a user