Index: javascript/themes/ez/editor_template.js
===================================================================
--- javascript/themes/ez/editor_template.js	(revision 8)
+++ javascript/themes/ez/editor_template.js	(revision 9)
@@ -1021,9 +1021,6 @@
                 if (p && (c = cm.get('pagebreak')))
                     c.setDisabled( !!p && DOM.hasClass(p, 'pagebreak') );
 
-                if (header && (c = cm.get('custom')))
-                    c.setDisabled( header );
-
                 p = DOM.getParent(n, 'IMG');
                 if (c = cm.get('image'))
                 {
Index: templates/ezoe/tag_custom.tpl
===================================================================
--- templates/ezoe/tag_custom.tpl	(revision 8)
+++ templates/ezoe/tag_custom.tpl	(revision 9)
@@ -28,14 +28,18 @@
         {
             if ( eZOEPopupUtils.getParentByTag( el, 'span', 'mceItemCustomTag', 'custom' ) )
                 filterOutCustomBlockTags( );
+            else if ( eZOEPopupUtils.getParentByTag( el, 'h1,h2,h3,h4,h5,h6' ) )
+                filterOutCustomBlockTags( );
         }
         else
         {
             var currentNode = ed.selection.getNode();
             if ( currentNode && currentNode.nodeName !== 'DIV' && tinymce.DOM.getAttrib( currentNode, 'type' ) === 'custom' )
                 filterOutCustomBlockTags( );
-            else if ( eZOEPopupUtils.getParentByTag( currentNode, 'span', 'mceItemCustomTag', 'custom' ) )
+            else if ( eZOEPopupUtils.getParentByTag( currentNode, 'span', 'mceItemCustomTag', 'custom', true ) )
                 filterOutCustomBlockTags( );
+            else if ( eZOEPopupUtils.getParentByTag( currentNode, 'h1,h2,h3,h4,h5,h6', false, false, true ) )
+                filterOutCustomBlockTags( );
         }
     },
     tagGenerator: function( tag, customTag, selectedHtml )
