diff options
author | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-23 16:45:10 +0000 |
---|---|---|
committer | dave <dave@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2008-06-23 16:45:10 +0000 |
commit | 01875b30b9e70d4bd355bc86f2a87771a0f59571 (patch) | |
tree | cb1fef56e09bcef6c189cffb834c8efb004ff1d2 /mod/profile | |
parent | 4b225fc844aec7dcce4692e8ac178cda7bd897fe (diff) | |
download | elgg-01875b30b9e70d4bd355bc86f2a87771a0f59571.tar.gz elgg-01875b30b9e70d4bd355bc86f2a87771a0f59571.tar.bz2 |
coordinates in for the icon cropper
git-svn-id: https://code.elgg.org/elgg/trunk@1071 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/profile')
-rw-r--r-- | mod/profile/views/default/profile/editicon.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/mod/profile/views/default/profile/editicon.php b/mod/profile/views/default/profile/editicon.php index c3da9511a..1fa891598 100644 --- a/mod/profile/views/default/profile/editicon.php +++ b/mod/profile/views/default/profile/editicon.php @@ -42,18 +42,21 @@ ?>
<script>
- function preview(img, selection) {
+
+ function preview(img, selection) {
+ var origWidth = $("#user_avatar").width();
+ var origHeight = $("#user_avatar").height();
var scaleX = 100 / selection.width;
var scaleY = 100 / selection.height;
$('#user_avatar + div > img').css({
- width: Math.round(scaleX * 600) + 'px',
- height: Math.round(scaleY * 500) + 'px',
+ width: Math.round(scaleX * origWidth) + 'px',
+ height: Math.round(scaleY * origHeight) + 'px',
marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px',
marginTop: '-' + Math.round(scaleY * selection.y1) + 'px'
}); }
- var $x1, $y1, $x2, $y2, $w, $h;
-
+ var $x1, $y1, $x2, $y2, $w, $h;
+
function selectChange(img, selection){
$x1.text(selection.x1);
$y1.text(selection.y1);
|