Skip to content

Commit 487104f

Browse files
committed
MAGETWO-32493: Remove bootstrap.js files
- Removed Catalog/../bootstrap.js . Fix to load via require call.
1 parent 04e0bc9 commit 487104f

File tree

5 files changed

+19
-22
lines changed

5 files changed

+19
-22
lines changed

app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ protected function _prepareLayout()
7878
[
7979
'id' => 'save',
8080
'label' => __('Save Category'),
81-
'onclick' => "categorySubmit('" . $this->getSaveUrl() . "', true)",
82-
'class' => 'save primary save-category'
81+
'class' => 'save primary save-category',
82+
'data_attribute' => [
83+
'mage-init' => [
84+
'Magento_Catalog/catalog/category/edit' => [
85+
'url' => $this->getSaveUrl(),
86+
'ajax' => true
87+
]
88+
]
89+
]
8390
]
8491
);
8592
}

app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd">
99
<head>
1010
<css src="jquery/fileUploader/css/jquery.fileupload-ui.css"/>
11-
<link src="Magento_Catalog::js/bootstrap/category-edit.js"/>
1211
</head>
1312
<update handle="editor"/>
1413
<body>

app/code/Magento/Catalog/view/adminhtml/web/catalog/category/edit.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
* Create/edit some category
77
*/
88
define([
9-
"jquery",
10-
"prototype"
11-
], function(jQuery){
9+
'jquery',
10+
'prototype'
11+
], function (jQuery) {
1212

13-
var categorySubmit = function (url, useAjax) {
13+
var categorySubmit = function (url, useAjax) {
1414
var activeTab = $('active_tab_id');
1515
if (activeTab) {
1616
if (activeTab.tabsJsObject && activeTab.tabsJsObject.tabs('activeAnchor')) {
@@ -69,6 +69,10 @@ var categorySubmit = function (url, useAjax) {
6969
jQuery('#category_edit_form').trigger('submit');
7070
};
7171

72-
window.categorySubmit = categorySubmit;
73-
72+
return function (config, element) {
73+
config = config.url || {};
74+
jQuery(element).on('click', function (event) {
75+
categorySubmit(config.url, config.ajax);
76+
});
77+
};
7478
});

app/code/Magento/Catalog/view/adminhtml/web/js/bootstrap.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app/code/Magento/Catalog/view/adminhtml/web/js/bootstrap/category-edit.js

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)