fixed several defaults bugs...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-11-22 07:26:28 +03:00
parent 0336afda01
commit b43d425ebc
2 changed files with 7 additions and 4 deletions

View File

@ -453,10 +453,12 @@ module.AppControl = core.ImageGridFeatures.Feature({
.replace('${VERSION}', this.version || 'gen4') .replace('${VERSION}', this.version || 'gen4')
.replace('${FILENAME}', .replace('${FILENAME}',
img ? img ?
(img.name || img.path.replace(/\.[\\\/]/, '')) (img.name
|| (img.path && img.path.replace(/\.[\\\/]/, ''))
|| '')
: '') : '')
.replace('${PATH}', .replace('${PATH}',
img ? (img && img.path) ?
(img.base_path || '.') (img.base_path || '.')
+'/'+ img.path.replace(/\.[\\\/]/, '') +'/'+ img.path.replace(/\.[\\\/]/, '')
: '') : '')

View File

@ -466,7 +466,7 @@ module.ImagesPrototype = {
return (img.base_path || path) ? return (img.base_path || path) ?
[img.base_path || path, img.path].join('/') [img.base_path || path, img.path].join('/')
: util.path2url(img.path) : util.path2url(img.path || IMAGE_DATA.path)
}, },
// NOTE: actual URL decoding and encoding is not done here to keep // NOTE: actual URL decoding and encoding is not done here to keep
// things consistent, rather it is done the the latest possible // things consistent, rather it is done the the latest possible
@ -483,7 +483,8 @@ module.ImagesPrototype = {
img_data = img_data == null ? this[gid] : img_data img_data = img_data == null ? this[gid] : img_data
// if no usable images are available use STUB data... // if no usable images are available use STUB data...
if((img_data.preview == null if(!img_data
|| (img_data.preview == null
|| Object.keys(img_data.preview).length == 0) || Object.keys(img_data.preview).length == 0)
&& img_data.path == null){ && img_data.path == null){
img_data = IMAGE_DATA img_data = IMAGE_DATA