Improved logo upload.
This commit is contained in:
parent
3bd59292e7
commit
89e00230f5
4 changed files with 18 additions and 5 deletions
|
@ -157,7 +157,11 @@ class App.SettingsAreaLogo extends App.Controller
|
||||||
|
|
||||||
maxSiteInMb = 8
|
maxSiteInMb = 8
|
||||||
if file.size && file.size > 1024 * 1024 * maxSiteInMb
|
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', '' )
|
@logoPreview.attr( 'src', '' )
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -206,4 +210,4 @@ class App.SettingsAreaLogo extends App.Controller
|
||||||
)
|
)
|
||||||
|
|
||||||
# add resized image
|
# add resized image
|
||||||
App.ImageService.resizeForAvatar( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
|
App.ImageService.resizeForApp( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
|
||||||
|
|
|
@ -369,7 +369,7 @@ class Base extends App.ControllerContent
|
||||||
)
|
)
|
||||||
|
|
||||||
# add resized image
|
# add resized image
|
||||||
App.ImageService.resizeForAvatar( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
|
App.ImageService.resizeForApp( @params.logo, @logoPreview.width(), @logoPreview.height(), store )
|
||||||
|
|
||||||
hideAlerts: =>
|
hideAlerts: =>
|
||||||
@$('.form-group').removeClass('has-error')
|
@$('.form-group').removeClass('has-error')
|
||||||
|
|
|
@ -6,7 +6,7 @@ class App.ImageService
|
||||||
else
|
else
|
||||||
@resize( dataURL, x, y, 2, 'image/jpeg', 0.7, callback )
|
@resize( dataURL, x, y, 2, 'image/jpeg', 0.7, callback )
|
||||||
|
|
||||||
@toDataURLForApp: (dataURL, x, y, callback) =>
|
@resizeForApp: (dataURL, x, y, callback) =>
|
||||||
if @checkUrl(dataURL)
|
if @checkUrl(dataURL)
|
||||||
callback(dataURL)
|
callback(dataURL)
|
||||||
else
|
else
|
||||||
|
|
|
@ -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;
|
margin: 0 auto 15px;
|
||||||
height: auto;
|
height: auto;
|
||||||
|
|
||||||
|
@ -4845,6 +4845,15 @@ label + .wizard-buttonList {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.branding .logo-preview:not([src=""]) {
|
||||||
|
margin: 20px auto 12px;
|
||||||
|
height: auto;
|
||||||
|
|
||||||
|
+ .logo-preview-placeholder {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.branding.login {
|
.branding.login {
|
||||||
padding: 24px 24px 0px;
|
padding: 24px 24px 0px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue