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.

Built from https://develop.svn.wordpress.org/trunk@29613


git-svn-id: http://core.svn.wordpress.org/trunk@29387 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-08-26 04:22:16 +00:00
parent 60c6399d1c
commit 80bda02c0f
6 changed files with 9 additions and 43 deletions

View File

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

File diff suppressed because one or more lines are too long

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 {

File diff suppressed because one or more lines are too long

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,

File diff suppressed because one or more lines are too long