Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

Commit c5f9fb4

Browse files
author
Stanislav Idolov
authored
ENGCOM-1871: [Forwardport] Format the javascript code #10 #15833
2 parents bd29d28 + e7dc28f commit c5f9fb4

File tree

2 files changed

+25
-10
lines changed
  • app/code/Magento/Ui/view/base

2 files changed

+25
-10
lines changed

app/code/Magento/Ui/view/base/templates/control/button/split.phtml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</button>
1818
<?php if ($block->hasSplit()): ?>
1919
<button <?= $block->getToggleAttributesHtml() ?>>
20-
<span>Select</span>
20+
<span><?= /* @escapeNotVerified */ __('Select'); ?></span>
2121
</button>
2222

2323
<?php if (!$block->getDisabled()): ?>
@@ -40,12 +40,10 @@
4040
<?php endif; ?>
4141
<?php endif; ?>
4242
</div>
43-
44-
<script>
45-
require(['jquery'], function($){
46-
$('.actions-split')
47-
.on('click.splitDefault', '.action-default', function() {
48-
$(this).siblings('.dropdown-menu').find('.item-default').trigger('click');
49-
});
50-
});
51-
</script>
43+
<script type="text/x-magento-init">
44+
{
45+
".actions-split": {
46+
"Magento_Ui/js/grid/controls/button/split": {}
47+
}
48+
}
49+
</script>
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery'
8+
], function ($) {
9+
'use strict';
10+
11+
return function (data, element) {
12+
13+
$(element).on('click.splitDefault', '.action-default', function () {
14+
$(this).siblings('.dropdown-menu').find('.item-default').trigger('click');
15+
});
16+
};
17+
});

0 commit comments

Comments
 (0)