Changeset 10208
- Timestamp:
- 10/07/2015 05:23:13 PM (9 years ago)
- Location:
- trunk/src/bp-core/js
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/js/avatar.js
r10160 r10208 34 34 // Avatars are uploaded files 35 35 this.avatars = bp.Uploader.filesUploaded; 36 37 // The Avatar Attachment object. 38 this.Attachment = new Backbone.Model(); 36 39 37 40 // Wait till the queue is reset … … 257 260 bp.Avatar.navItems.get( 'delete' ).set( { hide: 0 } ); 258 261 262 /** 263 * Set the Attachment object 264 * 265 * You can run extra actions once the avatar is set using: 266 * bp.Avatar.Attachment.on( 'change:url', function( data ) { your code } ); 267 * 268 * In this case data.attributes will include the url to the newly 269 * uploaded avatar, the object and the item_id concerned. 270 */ 271 self.Attachment.set( _.extend( 272 _.pick( avatar.attributes, ['object', 'item_id'] ), 273 { url: response.avatar, action: 'uploaded' } 274 ) ); 275 259 276 } ).fail( function( response ) { 260 277 var feedback = BP_Uploader.strings.default_error; … … 330 347 } ); 331 348 332 // Remove the Delete nav 333 bp.Avatar.navItems.get( 'delete' ).set( { active: 0, hide: 1 } ); 349 // Remove the Delete nav 350 bp.Avatar.navItems.get( 'delete' ).set( { active: 0, hide: 1 } ); 351 352 /** 353 * Reset the Attachment object 354 * 355 * You can run extra actions once the avatar is set using: 356 * bp.Avatar.Attachment.on( 'change:url', function( data ) { your code } ); 357 * 358 * In this case data.attributes will include the url to the gravatar, 359 * the object and the item_id concerned. 360 */ 361 self.Attachment.set( _.extend( 362 _.pick( model.attributes, ['object', 'item_id'] ), 363 { url: response.avatar, action: 'deleted' } 364 ) ); 334 365 335 366 } ).fail( function( response ) { -
trunk/src/bp-core/js/cover-image.js
r10160 r10208 20 20 this.views = new Backbone.Collection(); 21 21 this.warning = null; 22 23 // The Cover Image Attachment object. 24 this.Attachment = new Backbone.Model(); 22 25 23 26 // Set up views … … 126 129 BP_Uploader.settings.defaults.multipart_params.bp_params.has_cover_image = false; 127 130 131 /** 132 * Reset the Attachment object 133 * 134 * You can run extra actions once the cover image is set using: 135 * bp.CoverImage.Attachment.on( 'change:url', function( data ) { your code } ); 136 * 137 * In this case data.attributes will include the default url for the 138 * cover image (most of the time: ''), the object and the item_id concerned. 139 */ 140 self.Attachment.set( _.extend( 141 _.pick( model.attributes, ['object', 'item_id'] ), 142 { url: response.reset_url, action: 'deleted' } 143 ) ); 144 128 145 } ).fail( function( response ) { 129 146 var feedback = BP_Uploader.strings.default_error; … … 204 221 // Add the delete view 205 222 bp.CoverImage.deleteView(); 223 224 /** 225 * Set the Attachment object 226 * 227 * You can run extra actions once the cover image is set using: 228 * bp.CoverImage.Attachment.on( 'change:url', function( data ) { your code } ); 229 * 230 * In this case data.attributes will include the url to the newly 231 * uploaded cover image, the object and the item_id concerned. 232 */ 233 bp.CoverImage.Attachment.set( _.extend( 234 _.pick( BP_Uploader.settings.defaults.multipart_params.bp_params, ['object', 'item_id'] ), 235 { url: model.get( 'url' ), action: 'uploaded' } 236 ) ); 206 237 } 207 238 }
Note: See TracChangeset
for help on using the changeset viewer.