@ -27,6 +27,9 @@ export default {
selected : this . $store . state . config . theme ,
selected : this . $store . state . config . theme ,
invalidThemeImported : false ,
invalidThemeImported : false ,
keepShadows : false ,
keepRoundness : false ,
textColorLocal : '' ,
textColorLocal : '' ,
linkColorLocal : '' ,
linkColorLocal : '' ,
@ -375,6 +378,19 @@ export default {
} )
} )
} ,
} ,
clearRoundness ( ) {
Object . keys ( this . $data )
. filter ( _ => _ . endsWith ( 'RadiusLocal' ) )
. forEach ( key => {
set ( this . $data , key , undefined )
} )
} ,
clearShadows ( ) {
this . shadowsLocal = { }
console . log ( this . shadowsLocal )
} ,
/ * *
/ * *
* This applies stored theme data onto form .
* This applies stored theme data onto form .
* @ param { Object } input - input data
* @ param { Object } input - input data
@ -420,6 +436,8 @@ export default {
this [ key + 'ColorLocal' ] = rgb2hex ( colors [ key ] )
this [ key + 'ColorLocal' ] = rgb2hex ( colors [ key ] )
} )
} )
if ( ! this . keepRoundness ) {
this . clearRoundness ( )
// TODO optimize this
// TODO optimize this
this . btnRadiusLocal = radii . btn
this . btnRadiusLocal = radii . btn
this . inputRadiusLocal = radii . input
this . inputRadiusLocal = radii . input
@ -429,8 +447,13 @@ export default {
this . avatarAltRadiusLocal = radii . avatarAlt
this . avatarAltRadiusLocal = radii . avatarAlt
this . tooltipRadiusLocal = radii . tooltip
this . tooltipRadiusLocal = radii . tooltip
this . attachmentRadiusLocal = radii . attachment
this . attachmentRadiusLocal = radii . attachment
}
if ( ! this . keepShadows ) {
this . clearShadows ( )
this . shadowsLocal = shadows
this . shadowsLocal = shadows
this . shadowSelected = this . shadowsAvailable [ 0 ]
}
Object . entries ( opacity ) . forEach ( ( [ k , v ] ) => {
Object . entries ( opacity ) . forEach ( ( [ k , v ] ) => {
if ( typeof v === 'undefined' || v === null || Number . isNaN ( v ) ) return
if ( typeof v === 'undefined' || v === null || Number . isNaN ( v ) ) return
@ -441,7 +464,16 @@ export default {
watch : {
watch : {
selected ( ) {
selected ( ) {
if ( this . selectedVersion === 1 ) {
if ( this . selectedVersion === 1 ) {
if ( ! this . keepRoundness ) {
this . clearRoundness ( )
}
if ( ! this . keepShadows ) {
this . clearShadows ( )
}
this . clearV1 ( )
this . clearV1 ( )
this . bgColorLocal = this . selected [ 1 ]
this . bgColorLocal = this . selected [ 1 ]
this . fgColorLocal = this . selected [ 2 ]
this . fgColorLocal = this . selected [ 2 ]
this . textColorLocal = this . selected [ 3 ]
this . textColorLocal = this . selected [ 3 ]