Subida del módulo y tema de PrestaShop

This commit is contained in:
Kaloyan
2026-04-09 18:31:51 +02:00
parent 12c253296f
commit 16b3ff9424
39262 changed files with 7418797 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
import {ShowcaseCard} from '@PSTypes/showcase';
const {$} = window;
/**
* Class ShowcaseCardCloseExtension is responsible for providing helper block closing behavior
*/
export default class ShowcaseCardCloseExtension {
/**
* Extend helper block.
*
* @param {ShowcaseCard} helperBlock
*/
extend(helperBlock: ShowcaseCard): void {
const container = helperBlock.getContainer();
container.on('click', '.js-remove-helper-block', (evt: JQuery.ClickEvent) => {
container.remove();
const $btn = $(evt.target);
const url = $btn.data('closeUrl');
const cardName = $btn.data('cardName');
if (url) {
// notify the card was closed
$.post(url, {
close: 1,
name: cardName,
});
}
});
}
}

View File

@@ -0,0 +1,44 @@
/**
* For the full copyright and license information, please view the
* docs/licenses/LICENSE.txt file that was distributed with this source code.
*/
import {ShowcaseExtension} from '@PSTypes/showcase';
const {$} = window;
/**
* Class ShowcaseCard is responsible for handling events related with showcase card.
*/
export default class ShowcaseCard {
id: string;
$container: JQuery;
/**
* Showcase card id.
*
* @param {string} id
*/
constructor(id: string) {
this.id = id;
this.$container = $(`#${this.id}`);
}
/**
* Get showcase card container.
*
* @returns {jQuery}
*/
getContainer(): JQuery {
return this.$container;
}
/**
* Extend showcase card with external extensions.
*
* @param {object} extension
*/
addExtension(extension: ShowcaseExtension): void {
extension.extend(this);
}
}