Skip to content

Commit

Permalink
Merge pull request #11230 from colemanw/CRM-21385
Browse files Browse the repository at this point in the history
CRM-21385 - Hide wp admin bar when maximizing ckeditor
  • Loading branch information
colemanw authored Nov 4, 2017
2 parents d440ff5 + a1f06c8 commit 75959a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/crm.wordpress.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,12 @@ CRM.$(function($) {
// Restore admin bar position
$('#adminmenuwrap').css('z-index', '');
}
})
.on('crmWysiwygCreate', function(e, type, editor) {
if (type === 'ckeditor') {
editor.on('maximize', function(e) {
$('#wpadminbar').toggle(e.data === 2);
});
}
});
});
1 change: 1 addition & 0 deletions js/wysiwyg/crm.ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
editor.on('maximize', function (e) {
$('#civicrm-menu').toggle(e.data === 2);
});
$(editor.element.$).trigger('crmWysiwygCreate', ['ckeditor', editor]);
deferred.resolve();
}

Expand Down

0 comments on commit 75959a1

Please sign in to comment.