imports/ui/components/profile/avatar.js
/**
   * @description
   * At the modal confirm event, get the cropped image Blob data and upload it
   */
@description
At the modal confirm event, get the cropped image Blob data and upload it
@description At the modal confirm event get the cropped image Blob data and upload it
modalOnConfirm() {
    var dataURL = this.refs.avatarCropper.getCroppedDataUrl();
    if (dataURL && this.props.type) {
      switch (this.props.type) {
        case 'user':
          Meteor.call('user.profilePicture.update', dataURL, 'avatar', (err, res) => {
            if (err) { console.log(err); }
            else {
              this.refs.avatarUploadModal.hide();
              this.setState({modalShowConfirmBtn: false});
            }
          });
          break;
        case 'place':
          break;
      }
    }
  }
modalOnConfirm ( ) { var dataURL = this . refs . avatarCropper . getCroppedDataUrl ( ) ; if ( dataURL && this . props . type ) { switch ( this . props . type ) { case 'user' : Meteor . call ( 'user.profilePicture.update' , dataURL , 'avatar' , ( err , res ) => { if ( err ) { console . log ( err ) ; } else { this . refs . avatarUploadModal . hide ( ) ; this . setState ( { modalShowConfirmBtn : false } ) ; } } ) ; break ; case 'place' : break ; } } }
@description
 At the modal confirm event, get the cropped image Blob data and upload it
@description At the modal confirm event get the cropped image Blob data and upload it
// Get the cropped image Blob data // Close the modal // Hide the modal confirm button