Добрый день!
При нажатии на кнопку "В корзину" в карточке товара появляется всплывающее окно с предложением продолжить покупки или перейти в корзину и фото товара. Я так поняла, что размер окна определяется размером фото. У меня фото довольно крупное по тех. заданию. И получается, что окно практически равно ширине экрана, что не красиво и не удобно. Можно ли изменить размер окна, например, в два раза. Уменьшение фото прошу не предлагать.)))
Т.е. я должна внести изменения в файл script.js шаблона компонента элемента где-то здесь, но не знаю как:
window.JCCatalogElement.prototype.BasketResult = function(arResult)
{
var popupContent, popupButtons, popupTitle, productPict;
if (!!this.obPopupWin)
this.obPopupWin.close();
if (typeof arResult !== 'object')
return false;
if (arResult.STATUS === 'OK' && this.basketMode === 'BUY')
{
this.BasketRedirect();
}
else
{
this.InitPopupWindow();
popupTitle = {
content: BX.create('div', {
style: { marginRight: '30px', whiteSpace: 'nowrap' },
text: (arResult.STATUS === 'OK' ? BX.message('TITLE_SUCCESSFUL') : BX.message('TITLE_ERROR'))
})
};
if (arResult.STATUS === 'OK')
{
BX.onCustomEvent('OnBasketChange');
switch (this.productType)
{
case 1://
case 2://
productPict = this.product.pict.SRC;
break;
case 3:
productPict = (!!this.offers[this.offerNum].PREVIEW_PICTURE ?
this.offers[this.offerNum].PREVIEW_PICTURE.SRC :
this.defaultPict.pict.SRC
);
break;
}
popupContent = '<div style="width: 96%; margin: 10px 2%; text-align: center;"><img src="'+productPict+'" height="130"><p>'+this.product.name+'</p></div>';
if (this.config.showClosePopup)
{
popupButtons = [
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_BASKET_REDIRECT'),
events: {
click: BX.delegate(this.BasketRedirect, this)
},
style: {marginRight: '10px'}
}),
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_CLOSE_POPUP'),
events: {
click: BX.delegate(this.obPopupWin.close, this.obPopupWin)
}
})
];
}
else
{
popupButtons = [
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_BASKET_REDIRECT'),
events: {
click: BX.delegate(this.BasketRedirect, this)
}
})
];
}
}
else
{
popupContent = '<div style="width: 96%; margin: 10px 2%; text-align: center;"><p>'+(!!arResult.MESSAGE ? arResult.MESSAGE : BX.message('BASKET_UNKNOWN_ERROR'))+'</p></div>';
popupButtons = [
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_CLOSE'),
events: {
click: BX.delegate(this.obPopupWin.close, this.obPopupWin)
}
})
];
}
this.obPopupWin.setTitleBar(popupTitle);
this.obPopupWin.setContent(popupContent);
this.obPopupWin.setButtons(popupButtons);
this.obPopupWin.show();
}
return false;
};
Подскажите, пожалуйста.
При нажатии на кнопку "В корзину" в карточке товара появляется всплывающее окно с предложением продолжить покупки или перейти в корзину и фото товара. Я так поняла, что размер окна определяется размером фото. У меня фото довольно крупное по тех. заданию. И получается, что окно практически равно ширине экрана, что не красиво и не удобно. Можно ли изменить размер окна, например, в два раза. Уменьшение фото прошу не предлагать.)))
Т.е. я должна внести изменения в файл script.js шаблона компонента элемента где-то здесь, но не знаю как:
window.JCCatalogElement.prototype.BasketResult = function(arResult)
{
var popupContent, popupButtons, popupTitle, productPict;
if (!!this.obPopupWin)
this.obPopupWin.close();
if (typeof arResult !== 'object')
return false;
if (arResult.STATUS === 'OK' && this.basketMode === 'BUY')
{
this.BasketRedirect();
}
else
{
this.InitPopupWindow();
popupTitle = {
content: BX.create('div', {
style: { marginRight: '30px', whiteSpace: 'nowrap' },
text: (arResult.STATUS === 'OK' ? BX.message('TITLE_SUCCESSFUL') : BX.message('TITLE_ERROR'))
})
};
if (arResult.STATUS === 'OK')
{
BX.onCustomEvent('OnBasketChange');
switch (this.productType)
{
case 1://
case 2://
productPict = this.product.pict.SRC;
break;
case 3:
productPict = (!!this.offers[this.offerNum].PREVIEW_PICTURE ?
this.offers[this.offerNum].PREVIEW_PICTURE.SRC :
this.defaultPict.pict.SRC
);
break;
}
popupContent = '<div style="width: 96%; margin: 10px 2%; text-align: center;"><img src="'+productPict+'" height="130"><p>'+this.product.name+'</p></div>';
if (this.config.showClosePopup)
{
popupButtons = [
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_BASKET_REDIRECT'),
events: {
click: BX.delegate(this.BasketRedirect, this)
},
style: {marginRight: '10px'}
}),
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_CLOSE_POPUP'),
events: {
click: BX.delegate(this.obPopupWin.close, this.obPopupWin)
}
})
];
}
else
{
popupButtons = [
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_BASKET_REDIRECT'),
events: {
click: BX.delegate(this.BasketRedirect, this)
}
})
];
}
}
else
{
popupContent = '<div style="width: 96%; margin: 10px 2%; text-align: center;"><p>'+(!!arResult.MESSAGE ? arResult.MESSAGE : BX.message('BASKET_UNKNOWN_ERROR'))+'</p></div>';
popupButtons = [
new BasketButton({
ownerClass: this.obProduct.className,
text: BX.message('BTN_MESSAGE_CLOSE'),
events: {
click: BX.delegate(this.obPopupWin.close, this.obPopupWin)
}
})
];
}
this.obPopupWin.setTitleBar(popupTitle);
this.obPopupWin.setContent(popupContent);
this.obPopupWin.setButtons(popupButtons);
this.obPopupWin.show();
}
return false;
};
Подскажите, пожалуйста.