Skip to content

Commit

Permalink
Merge branch 't/10320'
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Apr 15, 2013
2 parents e6c0d93 + 4aa484d commit 5097130
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions plugins/justify/plugin.js
Expand Up @@ -38,7 +38,9 @@
this.value = value;
this.context = 'p';

var classes = editor.config.justifyClasses;
var classes = editor.config.justifyClasses,
blockTag = editor.config.enterMode == CKEDITOR.ENTER_P ? 'p' : 'div';

if ( classes ) {
switch ( value ) {
case 'left':
Expand All @@ -56,10 +58,10 @@
}

this.cssClassRegex = new RegExp( '(?:^|\\s+)(?:' + classes.join( '|' ) + ')(?=$|\\s)' );
this.requiredContent = 'p(' + this.cssClassName + ')';
this.requiredContent = blockTag + '(' + this.cssClassName + ')';
}
else {
this.requiredContent = 'p{text-align}';
this.requiredContent = blockTag + '{text-align}';
}

this.allowedContent = {
Expand All @@ -70,6 +72,11 @@
classes: this.cssClassName || null
}
};

// In enter mode BR we need to allow here for div, because when non other
// feature allows div justify is the only plugin that uses it.
if ( editor.config.enterMode == CKEDITOR.ENTER_BR )
this.allowedContent.div = true;
}

function onDirChanged( e ) {
Expand Down

0 comments on commit 5097130

Please sign in to comment.