diff options
Diffstat (limited to 'core/js/placeholder.js')
-rw-r--r-- | core/js/placeholder.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/js/placeholder.js b/core/js/placeholder.js index 74bb9b1881d..26eb3507d7b 100644 --- a/core/js/placeholder.js +++ b/core/js/placeholder.js @@ -47,16 +47,20 @@ */ (function ($) { - $.fn.imageplaceholder = function(seed, text) { + $.fn.imageplaceholder = function(seed, text, size) { // set optional argument "text" to value of "seed" if undefined text = text || seed; var hash = md5(seed), maxRange = parseInt('ffffffffffffffffffffffffffffffff', 16), hue = parseInt(hash, 16) / maxRange * 256, - height = this.height(); + height = this.height() || size || 32; this.css('background-color', 'hsl(' + hue + ', 90%, 65%)'); + // Placeholders are square + this.height(height); + this.width(height); + // CSS rules this.css('color', '#fff'); this.css('font-weight', 'normal'); |