- jQuery('[data-id="information-dialog-category"]').modal({
- modalClass: 'confirm',
- title: jQuery.mage.__('Warning message'),
- buttons: [{
- text: 'Cancel',
- class: 'action-secondary',
- click: function () {
- reRenderTree();
- this.closeModal();
- }
- }, {
- text: 'Ok',
- class: 'action-primary',
- click: function () {
- (function ($) {
- $.ajax({
- url: '<?= /* @escapeNotVerified */ $block->getMoveUrl() ?>',
- method: 'POST',
- data: registry.get('pd'),
- showLoader: true
- }).done(function (data) {
- if (data.error) {
- reRenderTree();
- } else {
- $(treeRoot).trigger('categoryMove.tree');
- }
- $('.page-main-actions').next('.messages').remove();
- $('.page-main-actions').next('#messages').remove();
- $('.page-main-actions').after(data.messages);
- }).fail(function (jqXHR, textStatus) {
- if (window.console) {
- console.log(textStatus);
- }
- location.reload();
- });
- })(jQuery);
- this.closeModal();
- }
- }]
-
- }).trigger('openModal');