Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stable10] fix theme logo position #569

Merged
merged 4 commits into from
Jul 27, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/theming/js/settings-admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion apps/theming/lib/controller/themingcontroller.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,11 @@ public function getStylesheet() {
if($logo !== '') {
$responseCss .= sprintf('#header .logo {
background-image: url(\'./logo?v='.$cacheBusterValue.'\');
background-size: contain;
}
#header .logo-icon {
background-image: url(\'./logo?v='.$cacheBusterValue.'\');
background-size: 62px 34px;
background-size: contain;
}'
);
}
Expand Down
9 changes: 6 additions & 3 deletions apps/theming/tests/lib/controller/ThemingControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,10 +383,11 @@ public function testGetStylesheetWithOnlyHeaderLogo() {

$expected = new Http\DataDownloadResponse('#header .logo {
background-image: url(\'./logo?v=0\');
background-size: contain;
}
#header .logo-icon {
background-image: url(\'./logo?v=0\');
background-size: 62px 34px;
background-size: contain;
}', 'style', 'text/css');
$expected->cacheFor(3600);
@$this->assertEquals($expected, $this->themingController->getStylesheet());
Expand Down Expand Up @@ -445,10 +446,11 @@ public function testGetStylesheetWithAllCombined() {

$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #000}#header .logo {
background-image: url(\'./logo?v=0\');
background-size: contain;
}
#header .logo-icon {
background-image: url(\'./logo?v=0\');
background-size: 62px 34px;
background-size: contain;
}#body-login {
background-image: url(\'./loginbackground?v=0\');
}', 'style', 'text/css');
Expand Down Expand Up @@ -479,10 +481,11 @@ public function testGetStylesheetWithAllCombinedInverted() {

$expected = new Http\DataDownloadResponse('#body-user #header,#body-settings #header,#body-public #header {background-color: #fff}#header .logo {
background-image: url(\'./logo?v=0\');
background-size: contain;
}
#header .logo-icon {
background-image: url(\'./logo?v=0\');
background-size: 62px 34px;
background-size: contain;
}#body-login {
background-image: url(\'./loginbackground?v=0\');
}#header .header-appname, #expandDisplayName { color: #000000; } #header .icon-caret { background-image: url(\'' . \OC::$WEBROOT . '/core/img/actions/caret-dark.svg\'); } .searchbox input[type="search"] { background: transparent url(\'' . \OC::$WEBROOT . '/core/img/actions/search.svg\') no-repeat 6px center; color: #000; }.searchbox input[type="search"]:focus,.searchbox input[type="search"]:active,.searchbox input[type="search"]:valid { color: #000; border: 1px solid rgba(0, 0, 0, .5); }', 'style', 'text/css');
Expand Down
3 changes: 2 additions & 1 deletion core/css/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
background-image: url('../img/logo-icon.svg');
background-repeat: no-repeat;
background-size: 175px;
background-position: center 30px;
background-position: center;
width: 252px;
height: 120px;
margin: 0 auto;
Expand All @@ -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;
}
Expand Down