Skip to content

Commit 9283a3e

Browse files
author
Denys Rul
committed
MAGETWO-32814: Fix dependency in inline code
- Remove global prototype dependency
1 parent 5a1f029 commit 9283a3e

File tree

1 file changed

+10
-10
lines changed
  • app/code/Magento/Backend/view/adminhtml/templates/page

1 file changed

+10
-10
lines changed

app/code/Magento/Backend/view/adminhtml/templates/page/locale.phtml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,16 @@
1010
<?php echo $this->getLocaleSelect(); ?>
1111
</div>
1212
<script>
13-
require([
14-
'prototype'
15-
], function () {
16-
function setInterfaceLanguage(event) {
17-
var elem = Event.element(event);
18-
if (elem) {
19-
window.location.href = '<?php echo $this->getChangeLocaleUrl() ?>locale/' + elem.value + '/<?php echo $this->getUrlForReferer() ?>';
20-
}
13+
(function () {
14+
'use strict';
15+
16+
var elem = document.getElementById('footer_interface_locale');
17+
18+
function onChange() {
19+
window.location.href = '<?php echo $this->getChangeLocaleUrl() ?>locale/' + elem.value + '/<?php echo $this->getUrlForReferer() ?>';
2120
}
22-
Event.observe('footer_interface_locale', 'change', setInterfaceLanguage);
23-
});
21+
22+
elem.addEventListener('change', onChange);
23+
})();
2424
</script>
2525
</div>

0 commit comments

Comments
 (0)