From d58ff6853173680e4156c482f6eb335586c8bb13 Mon Sep 17 00:00:00 2001
From: Julius Haertl <jus@bitgrid.net>
Date: Mon, 25 Jul 2016 18:54:13 +0200
Subject: [PATCH] Theming: Fix preview and center alignment of logo

---
 apps/theming/js/settings-admin.js | 8 ++++----
 core/css/header.css               | 1 +
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/apps/theming/js/settings-admin.js b/apps/theming/js/settings-admin.js
index 85e781411ed..941ec5c711b 100644
--- a/apps/theming/js/settings-admin.js
+++ b/apps/theming/js/settings-admin.js
@@ -75,11 +75,11 @@ function preview(setting, value) {
 		var logos = document.getElementsByClassName('logo-icon');
 		var timestamp = new Date().getTime();
 		if (value !== '') {
-			logos[0].style.background = "url('" + OC.generateUrl('/apps/theming/logo') + "?v" + timestamp + "')";
-			logos[0].style.backgroundSize = "62px 34px";
+			logos[0].style.backgroundImage = "url('" + OC.generateUrl('/apps/theming/logo') + "?v" + timestamp + "')";
+			logos[0].style.backgroundSize = "contain";
 		} else {
-			logos[0].style.background = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp +"')";
-			logos[0].style.backgroundSize = "62px 34px";
+			logos[0].style.backgroundImage = "url('" + OC.getRootPath() + '/core/img/logo-icon.svg?v' + timestamp +"')";
+			logos[0].style.backgroundSize = "contain";
 		}
 	}
 }
diff --git a/core/css/header.css b/core/css/header.css
index cf7c981955e..6078008f91f 100644
--- a/core/css/header.css
+++ b/core/css/header.css
@@ -82,6 +82,7 @@
 	display: inline-block;
 	background-image: url('../img/logo-icon.svg');
 	background-repeat: no-repeat;
+	background-position: center center;
 	width: 62px;
 	height: 34px;
 }
-- 
GitLab