TinyMCE: move the caption and gallery toolbars to the right, fix selected gallery border/outline, see #27320

git-svn-id: https://develop.svn.wordpress.org/trunk@27579 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2014-03-18 02:29:45 +00:00
parent 20eabd30ef
commit 30a83e48e2
2 changed files with 11 additions and 12 deletions

View File

@ -335,7 +335,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
} }
function addToolbar( node ) { function addToolbar( node ) {
var position, toolbarHtml, toolbar, var rectangle, toolbarHtml, toolbar, toolbarSize,
dom = editor.dom; dom = editor.dom;
removeToolbar(); removeToolbar();
@ -346,7 +346,7 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
} }
dom.setAttrib( node, 'data-wp-imgselect', 1 ); dom.setAttrib( node, 'data-wp-imgselect', 1 );
position = dom.getPos( node, editor.getBody() ); rectangle = dom.getRect( node );
toolbarHtml = '<div class="dashicons dashicons-edit edit" data-mce-bogus="1"></div> ' + toolbarHtml = '<div class="dashicons dashicons-edit edit" data-mce-bogus="1"></div> ' +
'<div class="dashicons dashicons-no-alt remove" data-mce-bogus="1"></div>'; '<div class="dashicons dashicons-no-alt remove" data-mce-bogus="1"></div>';
@ -358,10 +358,11 @@ tinymce.PluginManager.add( 'wpeditimage', function( editor ) {
}, toolbarHtml ); }, toolbarHtml );
editor.getBody().appendChild( toolbar ); editor.getBody().appendChild( toolbar );
toolbarSize = dom.getSize( toolbar );
dom.setStyles( toolbar, { dom.setStyles( toolbar, {
top: position.y, top: rectangle.y,
left: position.x left: rectangle.x + rectangle.w - toolbarSize.w
}); });
} }

View File

@ -229,6 +229,7 @@ embed {
position: relative; position: relative;
margin-bottom: 16px; margin-bottom: 16px;
cursor: pointer; cursor: pointer;
border: 1px solid transparent;
} }
.wpview-type-gallery:after { .wpview-type-gallery:after {
@ -239,13 +240,13 @@ embed {
.wpview-type-gallery.selected { .wpview-type-gallery.selected {
background-color: #f2f8ff; background-color: #f2f8ff;
outline: 1px solid #777; border-color: #777;
} }
.wpview-type-gallery .toolbar { .wpview-type-gallery .toolbar {
position: absolute; position: absolute;
top: 0; top: 0;
left: 0; right: 0;
background-color: #333; background-color: #333;
color: white; color: white;
display: none; display: none;
@ -273,11 +274,9 @@ embed {
} }
.gallery { .gallery {
margin: auto; margin: auto -6px;
padding: 0.5em 0; padding: 6px 0;
line-height: 1; line-height: 1;
margin-left: -0.5em;
margin-right: -0.5em;
overflow-x: hidden; overflow-x: hidden;
} }
@ -285,7 +284,7 @@ embed {
float: left; float: left;
margin: 0; margin: 0;
text-align: center; text-align: center;
padding: 0.5em; padding: 6px;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
box-sizing: border-box; box-sizing: border-box;
@ -338,7 +337,6 @@ embed {
} }
.gallery img { .gallery img {
border: 1px solid #cfcfcf;
max-width: 100%; max-width: 100%;
height: auto; height: auto;
} }