mirror of
https://github.com/processwire/processwire.git
synced 2025-08-14 10:45:54 +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',
|
||||
normal: 'InputfieldTinyMCENormal',
|
||||
loaded: 'InputfieldTinyMCELoaded',
|
||||
focused: 'InputfieldTinyMCEFocused',
|
||||
editor: 'InputfieldTinyMCEEditor',
|
||||
placeholder: 'InputfieldTinyMCEPlaceholder'
|
||||
},
|
||||
@@ -839,6 +840,7 @@ var InputfieldTinyMCE = {
|
||||
*
|
||||
*/
|
||||
documentReady: function() {
|
||||
var t = this;
|
||||
this.debug = ProcessWire.config.InputfieldTinyMCE.debug;
|
||||
this.isDocumentReady = true;
|
||||
this.log('documentReady', this.editorIds);
|
||||
@@ -849,6 +851,16 @@ var InputfieldTinyMCE = {
|
||||
this.initDocumentEvents();
|
||||
var $placeholders = jQuery('.' + this.cls.placeholder + ':visible');
|
||||
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) {
|
||||
this.log('qty',
|
||||
'normal=' + jQuery('.' + this.cls.normal).length + ', ' +
|
||||
|
Reference in New Issue
Block a user