mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 01:22:36 +08:00
FIX: Only consider image sizes from valid src values.
This commit is contained in:
parent
62f757da2c
commit
4000bcbfea
|
@ -327,11 +327,12 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, {
|
|||
imageSizes: function() {
|
||||
var result = {};
|
||||
$('#wmd-preview img').each(function(i, e) {
|
||||
var $img = $(e);
|
||||
result[$img.prop('src')] = {
|
||||
width: $img.width(),
|
||||
height: $img.height()
|
||||
};
|
||||
var $img = $(e),
|
||||
src = $img.prop('src');
|
||||
|
||||
if (src && src.length) {
|
||||
result[src] = { width: $img.width(), height: $img.height() };
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user