Skip to content

Commit

Permalink
Merge pull request #7541 from magento-gl/L3_Arrows_PR_20220329
Browse files Browse the repository at this point in the history
L3 arrows pr 20220329
  • Loading branch information
viktym authored Apr 11, 2022
2 parents 41631d5 + 294a4a2 commit 07d15f8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 29 deletions.
10 changes: 4 additions & 6 deletions app/code/Magento/Email/Model/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,21 +45,21 @@ class Template extends AbstractTemplate implements \Magento\Framework\Mail\Templ
* @deprecated
* @see \Magento\Email\Model\Transport::XML_PATH_SENDING_SET_RETURN_PATH
*/
const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';
public const XML_PATH_SENDING_SET_RETURN_PATH = 'system/smtp/set_return_path';

/**
* Configuration path for custom Return-Path email
* @deprecated
* @see \Magento\Email\Model\Transport::XML_PATH_SENDING_RETURN_PATH_EMAIL
*/
const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';
public const XML_PATH_SENDING_RETURN_PATH_EMAIL = 'system/smtp/return_path_email';

/**
* Config path to mail sending setting that shows if email communications are disabled
* @deprecated
* @see https://github.com/magento/magento2/issues/5988
*/
const XML_PATH_SYSTEM_SMTP_DISABLE = 'system/smtp/disable';
public const XML_PATH_SYSTEM_SMTP_DISABLE = 'system/smtp/disable';

/**
* BCC list
Expand All @@ -69,8 +69,6 @@ class Template extends AbstractTemplate implements \Magento\Framework\Mail\Templ
protected $_bcc = [];

/**
* Return path
*
* @var string
*/
protected $_returnPath = '';
Expand Down Expand Up @@ -253,7 +251,7 @@ public function getProcessedTemplateSubject(array $variables)
);

try {
$processedResult = $processor->setStoreId($storeId)->filter(__($this->getTemplateSubject())->render());
$processedResult = $processor->setStoreId($storeId)->filter($this->getTemplateSubject());
} catch (\Exception $e) {
$this->cancelDesignConfig();
throw new \Magento\Framework\Exception\MailException(__($e->getMessage()), $e);
Expand Down
21 changes: 15 additions & 6 deletions app/code/Magento/Email/Model/Template/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Magento\Framework\Filter\Template\Tokenizer\Parameter;
use Magento\Framework\Filter\VariableResolverInterface;
use Magento\Framework\Stdlib\StringUtils;
use Magento\Framework\Translate\Inline\StateInterface;
use Magento\Framework\UrlInterface;
use Magento\Framework\View\Asset\ContentProcessorException;
use Magento\Framework\View\Asset\ContentProcessorInterface;
Expand Down Expand Up @@ -53,12 +54,12 @@ class Filter extends Template
/**
* The name used in the {{trans}} directive
*/
const TRANS_DIRECTIVE_NAME = 'trans';
public const TRANS_DIRECTIVE_NAME = 'trans';

/**
* The regex to match interior portion of a {{trans "foo"}} translation directive
*/
const TRANS_DIRECTIVE_REGEX = '/^\s*([\'"])([^\1]*?)(?<!\\\)\1(\s.*)?$/si';
public const TRANS_DIRECTIVE_REGEX = '/^\s*([\'"])([^\1]*?)(?<!\\\)\1(\s.*)?$/si';

/**
* @var bool
Expand Down Expand Up @@ -119,8 +120,6 @@ class Filter extends Template

/**
* Core store config
* Variable factory
*
* @var VariableFactory
*/
protected $_variableFactory;
Expand Down Expand Up @@ -190,6 +189,11 @@ class Filter extends Template
*/
private $storeInformation;

/**
* @var StateInterface
*/
private $inlineTranslationState;

/**
* Filter constructor.
* @param StringUtils $string
Expand All @@ -211,6 +215,7 @@ class Filter extends Template
* @param array $variables
* @param array $directiveProcessors
* @param StoreInformation|null $storeInformation
* @param StateInterface|null $inlineTranslationState
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -232,7 +237,8 @@ public function __construct(
CssInliner $cssInliner,
$variables = [],
array $directiveProcessors = [],
?StoreInformation $storeInformation = null
?StoreInformation $storeInformation = null,
StateInterface $inlineTranslationState = null
) {
$this->_escaper = $escaper;
$this->_assetRepo = $assetRepo;
Expand All @@ -251,6 +257,8 @@ public function __construct(
$this->configVariables = $configVariables;
$this->storeInformation = $storeInformation ?:
ObjectManager::getInstance()->get(StoreInformation::class);
$this->inlineTranslationState = $inlineTranslationState ?:
ObjectManager::getInstance()->get(StateInterface::class);
parent::__construct($string, $variables, $directiveProcessors, $variableResolver);
}

Expand Down Expand Up @@ -616,8 +624,9 @@ public function transDirective($construction)
if (empty($text)) {
return '';
}

$this->inlineTranslationState->disable();
$text = __($text, $params)->render();
$this->inlineTranslationState->enable();
return $this->applyModifiers($text, $modifiers);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public function layoutDirectiveDataProvider()
* @param $expectedResult
* @param array $variables
* @internal param $translatorData
* @magentoConfigFixture default_store dev/translate_inline/active 1
* @magentoAppArea frontend
* @dataProvider transDirectiveDataProvider
*/
public function testTransDirective($directive, $translations, $expectedResult, $variables = [])
Expand Down
36 changes: 19 additions & 17 deletions lib/web/magnifier/magnifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,25 +541,27 @@

showWrapper = false;
$(thumbObj).on('load', function () {
data[idx].status = 1;

$(largeObj).on('load', function () {

if (largeObj.width > largeWrapper.width() || largeObj.height > largeWrapper.height()) {
showWrapper = true;
bindEvents(eventType, thumb);
data[idx].status = 2;
if (largeObj.width > largeObj.height) {
data[idx].zoom = largeObj.width / largeWrapper.width();
} else {
data[idx].zoom = largeObj.height / largeWrapper.height();
if (data.length > 0) {
data[idx].status = 1;

$(largeObj).on('load', function () {

if (largeObj.width > largeWrapper.width() || largeObj.height > largeWrapper.height()) {
showWrapper = true;
bindEvents(eventType, thumb);
data[idx].status = 2;
if (largeObj.width > largeObj.height) {
data[idx].zoom = largeObj.width / largeWrapper.width();
} else {
data[idx].zoom = largeObj.height / largeWrapper.height();
}
setThumbData(thumb, data[idx]);
updateLensOnLoad(idx, thumb, largeObj, largeWrapper);
}
setThumbData(thumb, data[idx]);
updateLensOnLoad(idx, thumb, largeObj, largeWrapper);
}
});
});

largeObj.src = data[idx].largeUrl;
largeObj.src = data[idx].largeUrl;
}
});

thumbObj.src = thumb.src;
Expand Down

0 comments on commit 07d15f8

Please sign in to comment.