Media Modal:

* the Image Details frame does not have a menu, indicate that by setting `menu: false` when adding states.
* mimic the default router rendering by toggling a `hide-menu` class on the frame when the region for menu is `null`
* remove the dead render code for the Image Details frame

See #29339.


git-svn-id: https://develop.svn.wordpress.org/trunk@29613 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-08-26 04:21:06 +00:00
parent 63205d3a43
commit 927fb11de7
2 changed files with 4 additions and 34 deletions

View File

@ -1779,10 +1779,6 @@
right: 140px;
}
.image-details .media-frame-menu {
display: none;
}
.image-details .media-frame-title,
.image-details .media-frame-content,
.image-details .media-frame-router {

View File

@ -462,6 +462,7 @@
mode = this.get('menu'),
view;
this.frame.$el.toggleClass( 'hide-menu', ! mode );
if ( ! mode ) {
return;
}
@ -791,7 +792,7 @@
title: l10n.imageDetailsTitle,
// Initial region modes.
content: 'image-details',
menu: 'image-details',
menu: false,
router: false,
toolbar: 'image-details',
@ -1244,6 +1245,7 @@
filterable: 'uploaded',
// Region mode defaults.
toolbar: 'replace',
menu: false,
priority: 60,
syncSelection: true
@ -2969,7 +2971,6 @@
this.on( 'menu:create:image-details', this.createMenu, this );
this.on( 'content:create:image-details', this.imageDetailsContent, this );
this.on( 'content:render:edit-image', this.editImageContent, this );
this.on( 'menu:render:image-details', this.renderMenu, this );
this.on( 'toolbar:render:image-details', this.renderImageDetailsToolbar, this );
// override the select toolbar
this.on( 'toolbar:render:replace', this.renderReplaceImageToolbar, this );
@ -2979,8 +2980,7 @@
this.states.add([
new media.controller.ImageDetails({
image: this.image,
editable: false,
menu: 'image-details'
editable: false
}),
new media.controller.ReplaceImage({
id: 'replace-image',
@ -2988,7 +2988,6 @@
image: this.image,
multiple: false,
title: l10n.imageReplaceTitle,
menu: 'image-details',
toolbar: 'replace',
priority: 80,
displaySettings: true
@ -3026,31 +3025,6 @@
},
renderMenu: function( view ) {
var lastState = this.lastState(),
previous = lastState && lastState.id,
frame = this;
view.set({
cancel: {
text: l10n.imageDetailsCancel,
priority: 20,
click: function() {
if ( previous ) {
frame.setState( previous );
} else {
frame.close();
}
}
},
separateCancel: new media.View({
className: 'separator',
priority: 40
})
});
},
renderImageDetailsToolbar: function() {
this.toolbar.set( new media.view.Toolbar({
controller: this,