Skip to:
Content

BuddyPress.org

Changeset 6572


Ignore:
Timestamp:
12/07/2012 07:05:28 AM (13 years ago)
Author:
johnjamesjacoby
Message:

Clean up some avatar cropper code. (1.6 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.6/bp-core/bp-core-cssjs.php

    r6003 r6572  
    5555
    5656    $width  = $image[0] / 2;
    57     $height = $image[1] / 2;
    58 ?>
     57    $height = $image[1] / 2; ?>
    5958
    6059    <script type="text/javascript">
     
    8180                var rx = <?php echo $full_width; ?> / coords.w;
    8281                var ry = <?php echo $full_height; ?> / coords.h;
     82                <?php if ( $image ) : ?>
     83                var w  = <?php echo $image[0]; ?>;
     84                var h  = <?php echo $image[1]; ?>;
     85                <?php endif; ?>
    8386
    8487                jQuery('#avatar-crop-preview').css({
    8588                <?php if ( $image ) : ?>
    86                     width: Math.round(rx * <?php echo $image[0]; ?>) + 'px',
    87                     height: Math.round(ry * <?php echo $image[1]; ?>) + 'px',
     89                    width: Math.round(rx * w) + 'px',
     90                    height: Math.round(ry * h) + 'px',
    8891                <?php endif; ?>
    8992                    marginLeft: '-' + Math.round(rx * coords.x) + 'px',
     
    105108 */
    106109function bp_core_add_cropper_inline_css() {
    107     global $bp;
    108110?>
    109111
    110112    <style type="text/css">
    111113        .jcrop-holder { float: left; margin: 0 20px 20px 0; text-align: left; }
    112         .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url( <?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif ); }
     114        .jcrop-vline, .jcrop-hline { font-size: 0; position: absolute; background: white top left repeat url('<?php echo BP_PLUGIN_URL ?>/bp-core/images/Jcrop.gif'); }
    113115        .jcrop-vline { height: 100%; width: 1px !important; }
    114116        .jcrop-hline { width: 100%; height: 1px !important; }
Note: See TracChangeset for help on using the changeset viewer.