Skip to content

Commit

Permalink
Merge branch 'master' into xwp/add/440-script-versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
kopepasah committed Apr 24, 2017
2 parents 842c0fd + b446899 commit 76eb13a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 12 deletions.
15 changes: 15 additions & 0 deletions editor/assets/stylesheets/_animations.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@mixin animate_fade {
animation: animate_fade 0.2s ease-out;
animation-fill-mode: forwards;
}

@keyframes animate_fade {
from {
opacity: 0;
transform: translateY( 4px );
}
to {
opacity: 1;
transform: translateY( 0px );
}
}
24 changes: 13 additions & 11 deletions editor/modes/visual-editor/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,19 @@ class VisualEditorBlock extends wp.element.Component {
className={ className }
>
{ ( ( isSelected && ! isTyping ) || isHovered ) && <BlockMover uid={ block.uid } /> }
<div className="editor-visual-editor__block-controls">
{ isSelected && ! isTyping && <BlockSwitcher uid={ block.uid } /> }
{ isSelected && ! isTyping && settings.controls ? (
<Toolbar
controls={ settings.controls.map( ( control ) => ( {
...control,
onClick: () => control.onClick( block.attributes, this.setAttributes ),
isActive: () => control.isActive( block.attributes )
} ) ) } />
) : null }
</div>
{ isSelected && ! isTyping &&
<div className="editor-visual-editor__block-controls">
<BlockSwitcher uid={ block.uid } />
{ !! settings.controls && (
<Toolbar
controls={ settings.controls.map( ( control ) => ( {
...control,
onClick: () => control.onClick( block.attributes, this.setAttributes ),
isActive: () => control.isActive( block.attributes )
} ) ) } />
) }
</div>
}
<BlockEdit
focus={ focus }
attributes={ block.attributes }
Expand Down
1 change: 1 addition & 0 deletions editor/modes/visual-editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
}

.editor-visual-editor__block-controls {
@include animate_fade;
position: absolute;
bottom: 100%;
margin-bottom: -4px;
Expand Down
2 changes: 1 addition & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const config = {
loader: 'sass-loader',
query: {
includePaths: [ 'editor/assets/stylesheets' ],
data: '@import "variables"; @import "mixins";',
data: '@import "variables"; @import "mixins"; @import "animations";',
outputStyle: 'production' === process.env.NODE_ENV ?
'compressed' : 'nested'
}
Expand Down

0 comments on commit 76eb13a

Please sign in to comment.