Improved logo upload.

This commit is contained in:
Martin Edenhofer 2015-07-12 07:32:22 +02:00
parent 3bd59292e7
commit 89e00230f5
4 changed files with 18 additions and 5 deletions

View file

@ -157,7 +157,11 @@ class App.SettingsAreaLogo extends App.Controller
maxSiteInMb = 8
if file.size && file.size > 1024 * 1024 * maxSiteInMb
#@showAlert( 'logo', App.i18n.translateInline( 'File too big, max. %s MB allowed.', maxSiteInMb ) )
App.Event.trigger 'notify', {
type: 'error'
msg: App.i18n.translateContent('File too big, max. %s MB allowed.', maxSiteInMb )
timeout: 2000
}
@logoPreview.attr( 'src', '' )
return
@ -206,4 +210,4 @@ class App.SettingsAreaLogo extends App.Controller
)
# add resized image
App.ImageService.resizeForAvatar( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
App.ImageService.resizeForApp( @params.logo, @logoPreview.width(), @logoPreview.height(), store )

View file

@ -369,7 +369,7 @@ class Base extends App.ControllerContent
)
# add resized image
App.ImageService.resizeForAvatar( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
App.ImageService.resizeForApp( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
hideAlerts: =>
@$('.form-group').removeClass('has-error')

View file

@ -6,7 +6,7 @@ class App.ImageService
else
@resize( dataURL, x, y, 2, 'image/jpeg', 0.7, callback )
@toDataURLForApp: (dataURL, x, y, callback) =>
@resizeForApp: (dataURL, x, y, callback) =>
if @checkUrl(dataURL)
callback(dataURL)
else

View file

@ -4832,7 +4832,7 @@ label + .wizard-buttonList {
}
}
.setup.wizard .logo-preview:not([src=""]), .branding .logo-preview:not([src=""]) {
.setup.wizard .logo-preview:not([src=""]) {
margin: 0 auto 15px;
height: auto;
@ -4845,6 +4845,15 @@ label + .wizard-buttonList {
margin-top: 15px;
}
.branding .logo-preview:not([src=""]) {
margin: 20px auto 12px;
height: auto;
+ .logo-preview-placeholder {
display: none;
}
}
.branding.login {
padding: 24px 24px 0px;
}