Changeset 29081
- Timestamp:
- 07/10/2014 11:02:51 PM (10 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/css/media-views.css
r29077 r29081 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; … … 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, … … 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 } -
trunk/src/wp-includes/js/media-grid.js
r29080 r29081 609 609 610 610 if ( bulkEditActive ) { 611 this.controller.deactivateMode( 'bulk-edit' ); 612 this.controller.activateMode( 'edit' ); 611 this.controller.deactivateMode( 'bulk-edit' ).activateMode( 'edit' ); 613 612 } else { 614 this.controller.deactivateMode( 'edit' ); 615 this.controller.activateMode( 'bulk-edit' ); 613 this.controller.deactivateMode( 'edit' ).activateMode( 'bulk-edit' ); 616 614 } 617 615 }, -
trunk/src/wp-includes/js/media-views.js
r29077 r29081 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' ); 1980 }, 1994 1995 return this; 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 }); … … 4826 4864 } 4827 4865 4828 details = selection.single(); 4829 this.$el.toggleClass( 'details', details === this.model ); 4866 // In bulk edit mode (in media grid), attachments don't open the "details" 4867 // pane, so a `details` class is unnecessary on the attachment view. 4868 if ( ! this.controller.isModeActive( 'bulk-edit' ) ) { 4869 details = selection.single(); 4870 this.$el.toggleClass( 'details', details === this.model ); 4871 } 4830 4872 }, 4831 4873 /**
Note: See TracChangeset
for help on using the changeset viewer.