File tree Expand file tree Collapse file tree 1 file changed +3
-50
lines changed
app/code/Magento/Catalog/view/adminhtml/web/js Expand file tree Collapse file tree 1 file changed +3
-50
lines changed Original file line number Diff line number Diff line change 5
5
6
6
define ( [
7
7
'jquery' ,
8
+ 'underscore' ,
8
9
'jquery/ui' ,
9
10
'jquery/jstree/jquery.jstree'
10
- ] , function ( $ ) {
11
+ ] , function ( $ , _ ) {
11
12
'use strict' ;
12
13
13
- var decodeEntities ,
14
- doc ,
15
- element ,
16
- x ;
17
-
18
- // noinspection JSUnusedAssignment
19
- decodeEntities = ( function ( ) {
20
- //create a new html document (doesn't execute script tags in child elements)
21
-
22
- doc = document . implementation . createHTMLDocument ( '' ) ;
23
- element = doc . createElement ( 'div' ) ;
24
-
25
- /**
26
- * Get Text Content
27
- * @param {* } str
28
- * @return {* }
29
- * @public
30
- */
31
- function getText ( str ) {
32
- element . innerHTML = str ;
33
- str = element . textContent ;
34
- element . textContent = '' ;
35
-
36
- return str ;
37
- }
38
-
39
- /**
40
- * Get HTML decoded Entities
41
- * @param {* } str
42
- * @return {* }
43
- * @public
44
- */
45
- function decodeHTMLEntities ( str ) {
46
- if ( str && typeof str === 'string' ) {
47
- x = getText ( str ) ;
48
-
49
- while ( str !== x ) {
50
- str = x ;
51
- x = getText ( x ) ;
52
- }
53
-
54
- return x ;
55
- }
56
- }
57
-
58
- return decodeHTMLEntities ;
59
- } ( decodeEntities || { } ) ) ;
60
-
61
14
$ . widget ( 'mage.categoryTree' , {
62
15
options : {
63
16
url : '' ,
@@ -138,7 +91,7 @@ define([
138
91
}
139
92
result = {
140
93
data : {
141
- title : decodeEntities ( node . name ) + ' (' + node [ 'product_count' ] + ')'
94
+ title : _ . unescape ( node . name ) + ' (' + node [ 'product_count' ] + ')'
142
95
} ,
143
96
attr : {
144
97
'class' : node . cls + ( ! ! node . disabled ? ' disabled' : '' ) //eslint-disable-line no-extra-boolean-cast
You can’t perform that action at this time.
0 commit comments