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 55
66define ( [
77 'jquery' ,
8- 'underscore ' ,
8+ 'mageUtils ' ,
99 'jquery/ui' ,
1010 'jquery/jstree/jquery.jstree'
11- ] , function ( $ , _ ) {
11+ ] , function ( $ , utils ) {
1212 'use strict' ;
1313
1414 $ . widget ( 'mage.categoryTree' , {
@@ -91,7 +91,7 @@ define([
9191 }
9292 result = {
9393 data : {
94- title : _ . unescape ( node . name ) + ' (' + node [ 'product_count' ] + ')'
94+ title : utils . unescape ( node . name ) + ' (' + node [ 'product_count' ] + ')'
9595 } ,
9696 attr : {
9797 '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([
242242 return data ;
243243 } ,
244244
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+
245265 /**
246266 * Converts PHP IntlFormatter format to moment format.
247267 *
You can’t perform that action at this time.
0 commit comments