summaryrefslogtreecommitdiffstats
path: root/core/js/placeholder.js
diff options
context:
space:
mode:
Diffstat (limited to 'core/js/placeholder.js')
-rw-r--r--core/js/placeholder.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/core/js/placeholder.js b/core/js/placeholder.js
index 6a1c653b587..318fe48ffa4 100644
--- a/core/js/placeholder.js
+++ b/core/js/placeholder.js
@@ -34,7 +34,7 @@
*
* Which will result in:
*
- * <div id="albumart" style="background-color: rgb(123, 123, 123)">T</div>
+ * <div id="albumart" style="background-color: rgb(123, 123, 123); ... ">T</div>
*
*/
@@ -45,7 +45,8 @@
red = parseInt(hash.substr(0,10), 16) / maxRange * 256,
green = parseInt(hash.substr(10,10), 16) / maxRange * 256,
blue = parseInt(hash.substr(20,10), 16) / maxRange * 256,
- rgb = [Math.floor(red), Math.floor(green), Math.floor(blue)];
+ rgb = [Math.floor(red), Math.floor(green), Math.floor(blue)],
+ height = this.height();
this.css('background-color', 'rgb(' + rgb.join(',') + ')');
// CSS rules
@@ -53,6 +54,10 @@
this.css('font-weight', 'bold');
this.css('text-align', 'center');
+ // calculate the height
+ this.css('line-height', height + 'px');
+ this.css('font-size', (height * 0.55) + 'px');
+
if(seed !== null && seed.length) {
this.html(seed[0].toUpperCase());
}