Commit 99a3b291 by wd

顶部free shipping bar 保存错误修复,字体单位更改,以及不存在时样式的修改

parent 9fc60a99
......@@ -88,24 +88,24 @@ class Save extends \Sparsh\FreeShippingBar\Controller\Adminhtml\Entity implement
}
//pc img upload
if ($_FILES['background_img']['name']){
if (isset($_FILES['background_img']['name']) && $_FILES['background_img']['name']){
$this->saveImg('background_img');
$data['background_img'] = '/'.self::FILE_DIR.'/'.$_FILES['background_img']['name'];
}
//phone img upload
if ($_FILES['background_img_phone']['name']){
if (isset($_FILES['background_img_phone']['name']) && $_FILES['background_img_phone']['name']){
$this->saveImg('background_img_phone');
$data['background_img_phone'] = '/'.self::FILE_DIR.'/'.$_FILES['background_img_phone']['name'];
}
//not request img info
if (is_array($data['background_img'])){
if (isset($data['background_img']) && is_array($data['background_img'])){
//no delete and no upload new img
unset($data['background_img']);
}
if (is_array($data['background_img_phone'])){
if (isset($data['background_img_phone']) && is_array($data['background_img_phone'])){
//no delete and no upload new img
unset($data['background_img_phone']);
}
......
......@@ -78,8 +78,8 @@ class FreeShippingBarActions extends Column
),
'label' => __('Delete'),
'confirm' => [
'title' => __('Delete ${ $.$data.name }'),
'message' => __('Are you sure you want to delete a ${ $.$data.name } record?')
'title' => __('Delete Free Shipping Bar'),
'message' => __('Are you sure you want to delete a Free Shipping Bar record?')
]
];
}
......
......@@ -41,7 +41,7 @@ endif;
}
</style>
<div class="sparsh-free-shipping-bar-goal-message"
style=" background-size: 100%; line-height: initial; text-align: center; background-color: <?= /* @noEscape */ $barData['bar_background_color']?>; font-size: <?= /* @noEscape */ $barData['bar_font_size'].'px'?>">
style=" background-size: 100%; line-height: initial; text-align: center; background-color: <?= /* @noEscape */ $barData['bar_background_color']?>; font-size: <?= /* @noEscape */ $barData['bar_font_size'].'em'?>">
<a <?= /* @noEscape */ $barData['is_clickable'] ? 'href='.$barData['bar_link_url'] : null ?>
<?= /* @noEscape */ $barData['is_clickable'] ? ($barData['is_link_open_in_new_page'] ? 'target=_blank' : 'target=_self') : null ?>
style="color: <?= /* @noEscape */ $barData['bar_text_color']?>">
......
......@@ -37,7 +37,13 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
}
require(['jquery'],function ($){
//free shipping bar not existent
if(!flag && !$('.sparsh-free-shipping-bar-goal-message').length){
$('.page-header').css('margin-top','0');
}
//auto logo height
if (flag){
var imgH = $('.logo').height();
imgH= Math.ceil(imgH/3);
......@@ -47,7 +53,12 @@ $logoHeight = $logoSizeResolver !== null && $logoSizeResolver->getHeight()
console.log(headerH);
$('.columns').css('margin-top',headerH);
}
});
</script>
<span data-action="toggle-nav" class="action nav-toggle"><span><?= $block->escapeHtml(__('Toggle Nav')) ?></span></span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment