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:
parent
60c6399d1c
commit
80bda02c0f
|
@ -1779,10 +1779,6 @@
|
||||||
left: 140px;
|
left: 140px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-details .media-frame-menu {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-details .media-frame-title,
|
.image-details .media-frame-title,
|
||||||
.image-details .media-frame-content,
|
.image-details .media-frame-content,
|
||||||
.image-details .media-frame-router {
|
.image-details .media-frame-router {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1779,10 +1779,6 @@
|
||||||
right: 140px;
|
right: 140px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-details .media-frame-menu {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.image-details .media-frame-title,
|
.image-details .media-frame-title,
|
||||||
.image-details .media-frame-content,
|
.image-details .media-frame-content,
|
||||||
.image-details .media-frame-router {
|
.image-details .media-frame-router {
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -462,6 +462,7 @@
|
||||||
mode = this.get('menu'),
|
mode = this.get('menu'),
|
||||||
view;
|
view;
|
||||||
|
|
||||||
|
this.frame.$el.toggleClass( 'hide-menu', ! mode );
|
||||||
if ( ! mode ) {
|
if ( ! mode ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -791,7 +792,7 @@
|
||||||
title: l10n.imageDetailsTitle,
|
title: l10n.imageDetailsTitle,
|
||||||
// Initial region modes.
|
// Initial region modes.
|
||||||
content: 'image-details',
|
content: 'image-details',
|
||||||
menu: 'image-details',
|
menu: false,
|
||||||
router: false,
|
router: false,
|
||||||
toolbar: 'image-details',
|
toolbar: 'image-details',
|
||||||
|
|
||||||
|
@ -1244,6 +1245,7 @@
|
||||||
filterable: 'uploaded',
|
filterable: 'uploaded',
|
||||||
// Region mode defaults.
|
// Region mode defaults.
|
||||||
toolbar: 'replace',
|
toolbar: 'replace',
|
||||||
|
menu: false,
|
||||||
|
|
||||||
priority: 60,
|
priority: 60,
|
||||||
syncSelection: true
|
syncSelection: true
|
||||||
|
@ -2969,7 +2971,6 @@
|
||||||
this.on( 'menu:create:image-details', this.createMenu, this );
|
this.on( 'menu:create:image-details', this.createMenu, this );
|
||||||
this.on( 'content:create:image-details', this.imageDetailsContent, this );
|
this.on( 'content:create:image-details', this.imageDetailsContent, this );
|
||||||
this.on( 'content:render:edit-image', this.editImageContent, 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 );
|
this.on( 'toolbar:render:image-details', this.renderImageDetailsToolbar, this );
|
||||||
// override the select toolbar
|
// override the select toolbar
|
||||||
this.on( 'toolbar:render:replace', this.renderReplaceImageToolbar, this );
|
this.on( 'toolbar:render:replace', this.renderReplaceImageToolbar, this );
|
||||||
|
@ -2979,8 +2980,7 @@
|
||||||
this.states.add([
|
this.states.add([
|
||||||
new media.controller.ImageDetails({
|
new media.controller.ImageDetails({
|
||||||
image: this.image,
|
image: this.image,
|
||||||
editable: false,
|
editable: false
|
||||||
menu: 'image-details'
|
|
||||||
}),
|
}),
|
||||||
new media.controller.ReplaceImage({
|
new media.controller.ReplaceImage({
|
||||||
id: 'replace-image',
|
id: 'replace-image',
|
||||||
|
@ -2988,7 +2988,6 @@
|
||||||
image: this.image,
|
image: this.image,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
title: l10n.imageReplaceTitle,
|
title: l10n.imageReplaceTitle,
|
||||||
menu: 'image-details',
|
|
||||||
toolbar: 'replace',
|
toolbar: 'replace',
|
||||||
priority: 80,
|
priority: 80,
|
||||||
displaySettings: true
|
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() {
|
renderImageDetailsToolbar: function() {
|
||||||
this.toolbar.set( new media.view.Toolbar({
|
this.toolbar.set( new media.view.Toolbar({
|
||||||
controller: this,
|
controller: this,
|
||||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue