Skip to content

Commit 5fae0d3

Browse files
authored
Merge pull request #251 from PrestaSafe/3.1.1
3.1.1
2 parents f78d323 + dc9ef41 commit 5fae0d3

File tree

17 files changed

+64
-36
lines changed

17 files changed

+64
-36
lines changed

_dev/src/components/Block.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const AddOnZOne = async (code) => {
5353
ajax_token: security_app.ajax_token,
5454
};
5555
let url = ajax_urls.block_action_urls;
56-
console.log(url, params)
5756
let data = await HttpClient.get(url, params);
5857
5958
prettyBlocksContext.emit("toggleModal");

_dev/src/components/LeftPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ const deleteAllBlocks = async () => {
196196
197197
if (response.success) {
198198
toaster.show(response.message)
199-
prettyBlocksContext.reloadIframe()
199+
window.location.reload()
200200
}
201201
})
202202
.catch(error => console.error(error));

_dev/src/components/Modal.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ onBeforeUnmount(() => {
5454
})
5555
5656
57-
57+
/**
58+
* reload blocks after save settings
59+
*/
60+
prettyBlocksContext.on('afterSaveSettings', () => {
61+
getBlocksAvailable()
62+
})
5863
5964
const getBlocksAvailable = () => {
6065
HttpClient.get(ajax_urls.blocks_available)

_dev/src/components/PanelThemeSettings.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ HttpClient.post(ajax_urls.state, params)
7777
if (data.message) {
7878
prettyBlocksContext.displayMessage(data.message)
7979
prettyBlocksContext.reloadIframe()
80+
prettyBlocksContext.emit('afterSaveSettings')
8081
}
8182
})
8283
.catch(error => console.error(error));

_dev/src/scripts/eventHandler.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@ export const eventHandler = async (event) => {
3333
current_url: custom_url
3434
}
3535
});
36+
prettyBlocksContext.changeUrl(custom_url)
3637
if(force_reload) {
3738
window.location.reload()
38-
}else{
39-
prettyBlocksContext.changeUrl(custom_url)
4039
}
4140
}
4241

_dev/src/store/pinia.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ export const usePrettyBlocksContext = defineStore('prettyBlocksContext', {
196196
},
197197
pushUrl(url) {
198198
const currentUrl = new URL(window.location.href);
199+
200+
// Remove 'id' and 'endpoint' parameters if they exist
201+
currentUrl.searchParams.delete('id');
202+
currentUrl.searchParams.delete('endpoint');
203+
199204
currentUrl.searchParams.set('startup_url', this.updateFilteredURL(url));
200205
window.history.replaceState({}, '', currentUrl.toString());
201206
},
@@ -208,6 +213,7 @@ export const usePrettyBlocksContext = defineStore('prettyBlocksContext', {
208213
} else if (!url.includes('prettyblocks')) {
209214
url += '&prettyblocks=1';
210215
}
216+
211217
return url;
212218
},
213219
reloadIframe(currentSrc = false) {

prettyblocks.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function __construct()
7272
{
7373
$this->name = 'prettyblocks';
7474
$this->tab = 'administration';
75-
$this->version = '3.1.0';
75+
$this->version = '3.1.1';
7676
$this->author = 'PrestaSafe';
7777
$this->need_instance = 1;
7878
$this->js_path = $this->_path . 'views/js/';
@@ -283,7 +283,6 @@ public function hookdisplayBackOfficeHeader($params)
283283
$this->context->controller->addJS($this->_path . 'views/js/back.js');
284284
}
285285
$this->context->controller->addCSS($this->_path . 'views/css/back.css');
286-
287286
}
288287

289288
public function install()
@@ -443,7 +442,8 @@ public function hookdisplayHeader($params)
443442
// todo register css and js on iframe only from Hook
444443
}
445444
// load default blocks styles
446-
if (!TplSettings::getSettings('remove_default_blocks')) {
445+
446+
if (!TplSettings::getSettings('remove_default_blocks', false)) {
447447
$this->context->controller->registerStylesheet(
448448
'tiny-slider-css',
449449
'https://cdnjs.cloudflare.com/ajax/libs/tiny-slider/2.9.4/tiny-slider.css',
@@ -677,7 +677,6 @@ public function hookActionRegisterThemeSettings()
677677
'description' => $this->l('Remove default blocks (if you using yours custom blocks)'), // description to display
678678
'tab' => 'Settings',
679679
'default' => false, // default value (Boolean)
680-
'private' => true,
681680
],
682681
];
683682
}
@@ -694,8 +693,7 @@ public function hookActionRegisterBlock($params)
694693
new PrettyBlocksCmsContentBlock($this),
695694
new PrettyBlocksCategoryDescriptionBlock($this),
696695
];
697-
698-
if (!TplSettings::getSettings('remove_default_blocks')) {
696+
if (!TplSettings::getSettings('remove_default_blocks', false)) {
699697
$defaultsBlocks[] = new PrettyBlocksTinySlider($this);
700698
$defaultsBlocks[] = new PrettyBlocksCustomImage($this);
701699
$defaultsBlocks[] = new PrettyBlocksFAQ($this);

views/css/_dev/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,4 +168,4 @@
168168
left: 50%;
169169
right: 50%;
170170
transform: translateX(-50%);
171-
}
171+
}

views/css/dist/main.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1652,4 +1652,4 @@
16521652
paint-order: markers;
16531653
}
16541654
}
1655-
}
1655+
}

views/css/iframe.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
border-radius: 4px;
107107
}
108108

109+
109110
/* [data-prettyblocks-zone].ondrag{
110111
background-color: #646cff;
111112
border: 1px solid #646cff;

0 commit comments

Comments
 (0)