|
|
@ -1307,29 +1307,33 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var $image = $img.find('img');
|
|
|
|
var $image = $img.find('img');
|
|
|
|
var onLoad = function () {
|
|
|
|
var onLoad = function () {
|
|
|
|
var w = $image.width();
|
|
|
|
var img = new Image();
|
|
|
|
var h = $image.height();
|
|
|
|
img.src = $image.attr('src');
|
|
|
|
|
|
|
|
img.onload = function () {
|
|
|
|
|
|
|
|
var w = img.width;
|
|
|
|
|
|
|
|
var h = img.height;
|
|
|
|
if (w>h) {
|
|
|
|
if (w>h) {
|
|
|
|
$image.css('max-height', '100%');
|
|
|
|
$image.css('max-height', '100%');
|
|
|
|
$img.css('flex-direction', 'row');
|
|
|
|
$img.css('flex-direction', 'column');
|
|
|
|
if (cb) { cb($img); }
|
|
|
|
if (cb) { cb($img); }
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$image.css('max-width', '100%');
|
|
|
|
$image.css('max-width', '100%');
|
|
|
|
$img.css('flex-direction', 'column');
|
|
|
|
$img.css('flex-direction', 'row');
|
|
|
|
if (cb) { cb($img); }
|
|
|
|
if (cb) { cb($img); }
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
if ($image[0].complete) { onLoad(); }
|
|
|
|
if ($image[0].complete) { onLoad(); }
|
|
|
|
$image.on('load', onLoad);
|
|
|
|
$image.on('load', onLoad);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
observer.observe($img[0], {
|
|
|
|
observer.observe($img[0], {
|
|
|
|
attributes: false,
|
|
|
|
attributes: false,
|
|
|
|
childList: true,
|
|
|
|
childList: true,
|
|
|
|
characterData: false
|
|
|
|
characterData: false
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -1622,7 +1626,11 @@ define([
|
|
|
|
var $avatar = $userAdmin.find('.buttonTitle');
|
|
|
|
var $avatar = $userAdmin.find('.buttonTitle');
|
|
|
|
var url = getStore() ? getStore().getProfile().avatar : undefined;
|
|
|
|
var url = getStore() ? getStore().getProfile().avatar : undefined;
|
|
|
|
$avatar.html('');
|
|
|
|
$avatar.html('');
|
|
|
|
common.displayAvatar($avatar, url, accountName, function ($img) {});
|
|
|
|
common.displayAvatar($avatar, url, accountName, function ($img) {
|
|
|
|
|
|
|
|
if ($img) {
|
|
|
|
|
|
|
|
$userAdmin.find('button').addClass('avatar');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$userAdmin.find('a.logout').click(function () {
|
|
|
|
$userAdmin.find('a.logout').click(function () {
|
|
|
|