diff --git a/src/wp-includes/css/media-views.css b/src/wp-includes/css/media-views.css
index 0a2ced6..1e4e70f 100644
|
a
|
b
|
|
| 903 | 903 | display: block; |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | | .attachment.details { |
| | 906 | .attachment.details, |
| | 907 | .media-grid-view .selected.attachment { |
| 907 | 908 | -webkit-box-shadow: 0 0 0 1px #fff, |
| 908 | 909 | 0 0 0 5px #1e8cbe; |
| 909 | 910 | box-shadow: 0 0 0 1px #fff, |
| 910 | 911 | 0 0 0 5px #1e8cbe; |
| 911 | 912 | } |
| 912 | 913 | |
| 913 | | .attachment.details .check { |
| | 914 | .attachment.details .check, |
| | 915 | .media-grid-view .attachment .check { |
| 914 | 916 | background-color: #1e8cbe; |
| 915 | 917 | -webkit-box-shadow: 0 0 0 1px #fff, |
| 916 | 918 | 0 0 0 2px #1e8cbe; |
| … |
… |
|
| 918 | 920 | 0 0 0 2px #1e8cbe; |
| 919 | 921 | } |
| 920 | 922 | |
| 921 | | .attachment.details .check div { |
| | 923 | .attachment.details .check div, |
| | 924 | .media-grid-view .attachment .check div { |
| 922 | 925 | background-position: -21px 0; |
| 923 | 926 | } |
| 924 | 927 | |
| 925 | | .attachment.details .check:hover div { |
| | 928 | .attachment.details .check:hover div, |
| | 929 | .media-grid-view .attachment .check:hover div { |
| 926 | 930 | background-position: -60px 0; |
| 927 | 931 | } |
| 928 | 932 | |
diff --git a/src/wp-includes/js/media-grid.js b/src/wp-includes/js/media-grid.js
index 71dc812..0b5a38f 100644
|
a
|
b
|
|
| 608 | 608 | media.view.Button.prototype.click.apply( this, arguments ); |
| 609 | 609 | |
| 610 | 610 | if ( bulkEditActive ) { |
| 611 | | this.controller.deactivateMode( 'bulk-edit' ); |
| 612 | | this.controller.activateMode( 'edit' ); |
| | 611 | this.controller.deactivateMode( 'bulk-edit' ) |
| | 612 | .activateMode( 'edit' ); |
| 613 | 613 | } else { |
| 614 | | this.controller.deactivateMode( 'edit' ); |
| 615 | | this.controller.activateMode( 'bulk-edit' ); |
| | 614 | this.controller.deactivateMode( 'edit' ) |
| | 615 | .activateMode( 'bulk-edit' ); |
| 616 | 616 | } |
| 617 | 617 | }, |
| 618 | 618 | |
diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js
index 5f53808..dfff517 100644
|
a
|
b
|
|
| 1970 | 1970 | eventToTrigger = model.get('id') + ':' + modeEventMap[collectionEvent]; |
| 1971 | 1971 | this.trigger( eventToTrigger ); |
| 1972 | 1972 | }, |
| | 1973 | /** |
| | 1974 | * Activate a mode on the frame. |
| | 1975 | * |
| | 1976 | * @param string mode Mode ID. |
| | 1977 | * @returns {this} Returns itself to allow chaining. |
| | 1978 | */ |
| 1973 | 1979 | activateMode: function( mode ) { |
| 1974 | | if ( this.activeModes.where( { id: mode } ).length ) { |
| | 1980 | // Bail if the mode is already active. |
| | 1981 | if ( this.isModeActive( mode ) ) { |
| 1975 | 1982 | return; |
| 1976 | 1983 | } |
| 1977 | 1984 | this.activeModes.add( [ { id: mode } ] ); |
| | 1985 | // Add a css class to the frame for anything that needs to be styled |
| | 1986 | // for the mode. |
| 1978 | 1987 | this.$el.addClass( 'mode-' + mode ); |
| | 1988 | /** |
| | 1989 | * Frame mode activation event. |
| | 1990 | * |
| | 1991 | * @event this#{mode}:activate |
| | 1992 | */ |
| 1979 | 1993 | this.trigger( mode + ':activate' ); |
| | 1994 | |
| | 1995 | return this; |
| 1980 | 1996 | }, |
| | 1997 | /** |
| | 1998 | * Deactivate a mode on the frame. |
| | 1999 | * |
| | 2000 | * @param string mode Mode ID. |
| | 2001 | * @returns {this} Returns itself to allow chaining. |
| | 2002 | */ |
| 1981 | 2003 | deactivateMode: function( mode ) { |
| 1982 | 2004 | // Bail if the mode isn't active. |
| 1983 | | if ( ! this.activeModes.where( { id: mode } ).length ) { |
| | 2005 | if ( ! this.isModeActive( mode ) ) { |
| 1984 | 2006 | return; |
| 1985 | 2007 | } |
| 1986 | 2008 | this.activeModes.remove( this.activeModes.where( { id: mode } ) ); |
| 1987 | 2009 | this.$el.removeClass( 'mode-' + mode ); |
| | 2010 | /** |
| | 2011 | * Frame mode deactivation event. |
| | 2012 | * |
| | 2013 | * @event this#{mode}:deactivate |
| | 2014 | */ |
| 1988 | 2015 | this.trigger( mode + ':deactivate' ); |
| | 2016 | |
| | 2017 | return this; |
| | 2018 | }, |
| | 2019 | /** |
| | 2020 | * Check if a mode is enabled on the frame. |
| | 2021 | * |
| | 2022 | * @param string mode Mode ID. |
| | 2023 | * @return bool |
| | 2024 | */ |
| | 2025 | isModeActive: function( mode ) { |
| | 2026 | return Boolean( this.activeModes.where( { id: mode } ).length ); |
| 1989 | 2027 | } |
| 1990 | 2028 | }); |
| 1991 | 2029 | |
| … |
… |
|
| 4819 | 4857 | */ |
| 4820 | 4858 | details: function( model, collection ) { |
| 4821 | 4859 | var selection = this.options.selection, |
| 4822 | | details; |
| | 4860 | details, |
| | 4861 | addAttachmentDetailsClass; |
| 4823 | 4862 | |
| 4824 | 4863 | if ( selection !== collection ) { |
| 4825 | 4864 | return; |
| 4826 | 4865 | } |
| 4827 | 4866 | |
| 4828 | | details = selection.single(); |
| 4829 | | this.$el.toggleClass( 'details', details === this.model ); |
| | 4867 | // In bulk edit mode (in media grid), attachments don't open the "details" |
| | 4868 | // pane, so a `details` class is unnecessary on the attachment view. |
| | 4869 | addAttachmentDetailsClass = ! this.controller.isModeActive( 'bulk-edit' ); |
| | 4870 | |
| | 4871 | if ( addAttachmentDetailsClass ) { |
| | 4872 | details = selection.single(); |
| | 4873 | this.$el.toggleClass( 'details', details === this.model ); |
| | 4874 | } |
| | 4875 | |
| 4830 | 4876 | }, |
| 4831 | 4877 | /** |
| 4832 | 4878 | * @param {Object} event |