File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed
app/code/Magento/Catalog/view/adminhtml/web/js Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change 5
5
6
6
define ( [
7
7
'jquery' ,
8
- 'underscore ' ,
8
+ 'mageUtils ' ,
9
9
'jquery/ui' ,
10
10
'jquery/jstree/jquery.jstree'
11
- ] , function ( $ , _ ) {
11
+ ] , function ( $ , utils ) {
12
12
'use strict' ;
13
13
14
14
$ . widget ( 'mage.categoryTree' , {
@@ -91,7 +91,7 @@ define([
91
91
}
92
92
result = {
93
93
data : {
94
- title : _ . unescape ( node . name ) + ' (' + node [ 'product_count' ] + ')'
94
+ title : utils . unescape ( node . name ) + ' (' + node [ 'product_count' ] + ')'
95
95
} ,
96
96
attr : {
97
97
'class' : node . cls + ( ! ! node . disabled ? ' disabled' : '' ) //eslint-disable-line no-extra-boolean-cast
Original file line number Diff line number Diff line change @@ -242,6 +242,26 @@ define([
242
242
return data ;
243
243
} ,
244
244
245
+ /**
246
+ * Replaces symbol codes with their unescaped counterparts.
247
+ *
248
+ * @param {String } data
249
+ *
250
+ * @returns {String }
251
+ */
252
+ unescape : function ( data ) {
253
+ var unescaped = _ . unescape ( data ) ,
254
+ map = {
255
+ ''' : '\''
256
+ } ;
257
+
258
+ _ . each ( map , function ( value , key ) {
259
+ unescaped = unescaped . replace ( key , value ) ;
260
+ } ) ;
261
+
262
+ return unescaped ;
263
+ } ,
264
+
245
265
/**
246
266
* Converts PHP IntlFormatter format to moment format.
247
267
*
You can’t perform that action at this time.
0 commit comments