Changeset 22332
- Timestamp:
- 10/30/2012 09:09:45 PM (12 years ago)
- Location:
- trunk/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/css/media-views.css
r22325 r22332 217 217 } 218 218 219 .selected.attachment { 220 box-shadow: 221 0 0 0 1px #fff, 222 0 0 0 4px #777; 223 } 224 225 .details.attachment { 226 box-shadow: 227 0 0 0 1px #fff, 228 0 0 0 4px #1e8cbe; 229 } 230 231 219 232 .attachment.library.selected:after { 220 233 content: '\2713'; … … 223 236 width: 24px; 224 237 position: absolute; 225 top: 0;226 left: 0;238 top: -1px; 239 right: -1px; 227 240 line-height: 24px; 228 241 font-size: 18px; 229 242 text-align: center; 230 243 color: #fff; 231 background: #21759b; 244 text-shadow: 0 1px 0 rgba( 0, 0, 0, 0.5 ); 245 background: #777; 246 border: 1px solid #fff; 247 /*border-width: 0 1px 1px 0;*/ 248 border-width: 0 0 1px 1px; 249 box-shadow: -1px 1px 0 rgba( 0, 0, 0, 0.1 ); 250 } 251 252 .attachment.library.details:after { 253 background: #1e8cbe; 232 254 } 233 255 … … 277 299 box-shadow: inset 0 0 0 1px rgba( 0, 0, 0, 0.1 ); 278 300 overflow: hidden; 301 } 302 303 .attachment.selected .attachment-preview:after { 304 box-shadow: 305 inset 0 0 0 1px rgba( 0, 0, 0, 0.1 ), 306 inset 0 0 10px 5px rgba( 0, 0, 0, 0.2 ); 279 307 } 280 308 -
trunk/wp-includes/js/media-views.js
r22324 r22332 132 132 133 133 if ( ! this.get('gutter') ) 134 this.set( 'gutter', 6);134 this.set( 'gutter', 8 ); 135 135 136 136 this.on( 'activate', this.activate, this ); … … 148 148 if ( this.get('multiple') ) 149 149 wp.Uploader.queue.on( 'add', this.selectUpload, this ); 150 151 this.get('selection').on( 'add remove', this.toggleDetails, this );152 150 }, 153 151 … … 158 156 159 157 wp.Uploader.queue.off( 'add', this.selectUpload, this ); 160 this.get('selection').off( 'add remove', this.toggleDetails, this );161 158 }, 162 159 … … 235 232 }, 236 233 237 toggle Details: function( model ) {234 toggleSelection: function( model ) { 238 235 var details = this.get('details'), 239 selection = this.get('selection'); 240 241 if ( selection.has( model ) ) 236 selection = this.get('selection'), 237 selected = selection.has( model ); 238 239 if ( ! selection ) 240 return; 241 242 if ( ! selected ) 243 selection.add( model ); 244 245 // If the model is not the same as the details model, 246 // it now becomes the details model. If the model is 247 // in the selection, it is not removed. 248 if ( details !== model ) { 242 249 this.set( 'details', model ); 243 else if ( selection.length ) 250 return; 251 } 252 253 // The model is the details model. 254 // Removed it from the selection. 255 selection.remove( model ); 256 257 // Show the last selected item, or clear the details view. 258 if ( selection.length ) 244 259 this.set( 'details', selection.last() ); 245 260 else 246 261 this.unset('details'); 262 247 263 } 248 264 }); … … 1073 1089 this.select(); 1074 1090 1075 return this; 1091 // Update the model's details view. 1092 this.controller.state().on( 'change:details', this.details, this ); 1093 this.details(); 1094 1095 return this; 1096 }, 1097 1098 destroy: function() { 1099 this.controller.state().off( 'change:details', this.details, this ); 1076 1100 }, 1077 1101 … … 1082 1106 1083 1107 toggleSelection: function( event ) { 1084 var selection = this.controller.state().get('selection'); 1085 1086 if ( ! selection ) 1087 return; 1088 1089 selection[ selection.has( this.model ) ? 'remove' : 'add' ]( this.model ); 1108 this.controller.state().toggleSelection( this.model ); 1090 1109 }, 1091 1110 … … 1118 1137 1119 1138 this.$el.removeClass('selected'); 1139 }, 1140 1141 details: function() { 1142 var details = this.controller.state().get('details'); 1143 this.$el.toggleClass( 'details', details === this.model ); 1120 1144 }, 1121 1145
Note: See TracChangeset
for help on using the changeset viewer.