@@ -35,7 +35,16 @@ define([
35
35
36
36
// Register Widget plugin button
37
37
editor . ui . registry . addIcon ( 'magentowidget' ,
38
- '<svg width="24" height="24" viewBox="0 0 32.000000 32.000000" preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,32.000000) scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M130 290 c0 -5 13 -10 30 -10 22 0 28 -4 24 -15 -5 -11 2 -15 26 -15 21 0 30 -4 28 -12 -7 -20 -40 -22 -50 -4 -5 9 -14 16 -20 16 -6 0 -19 7 -28 15 -9 8 -25 12 -38 8 -33 -8 -27 -26 8 -21 34 5 40 -6 12 -21 -14 -7 -25 -6 -40 5 -12 8 -23 10 -27 5 -5 -8 88 -71 105 -71 3 0 29 14 58 31 l53 30 -23 18 c-13 10 -31 20 -40 24 -10 3 -18 11 -18 17 0 5 -13 10 -30 10 -16 0 -30 -4 -30 -10z m58 -82 c-3 -7 -15 -13 -28 -13 -13 0 -25 6 -27 13 -3 8 6 12 27 12 21 0 30 -4 28 -12z"/> <path d="M30 151 l0 -60 61 -36 c33 -19 64 -35 69 -35 5 0 36 16 69 35 l61 36 0 60 0 61 -65 -37 -65 -36 -65 36 -65 37 0 -61z"/> </g> </svg>' ) ;
38
+ '<svg width="24" height="24" viewBox="0 0 32.000000 32.000000" ' +
39
+ 'preserveAspectRatio="xMidYMid meet"> <g transform="translate(0.000000,32.000000) ' +
40
+ 'scale(0.100000,-0.100000)" fill="#000000" stroke="none"> <path d="M130 290 c0 -5 13 -10 30 ' +
41
+ '-10 22 0 28 -4 24 -15 -5 -11 2 -15 26 -15 21 0 30 -4 28 -12 -7 -20 -40 -22 -50 -4 -5 9 -14 16 ' +
42
+ '-20 16 -6 0 -19 7 -28 15 -9 8 -25 12 -38 8 -33 -8 -27 -26 8 -21 34 5 40 -6 12 -21 -14 -7 -25 -6 ' +
43
+ '-40 5 -12 8 -23 10 -27 5 -5 -8 88 -71 105 -71 3 0 29 14 58 31 l53 30 -23 18 c-13 10 -31 20 -40 ' +
44
+ '24 -10 3 -18 11 -18 17 0 5 -13 10 -30 10 -16 0 -30 -4 -30 -10z m58 -82 c-3 -7 -15 -13 -28 -13 ' +
45
+ '-13 0 -25 6 -27 13 -3 8 6 12 27 12 21 0 30 -4 28 -12z"/> <path d="M30 151 l0 -60 61 -36 c33 ' +
46
+ '-19 64 -35 69 -35 5 0 36 16 69 35 l61 36 0 60 0 61 -65 -37 -65 -36 -65 36 -65 37 0 -61z"/> </g>' +
47
+ '</svg>' ) ;
39
48
editor . ui . registry . addToggleButton ( 'magentowidget' , {
40
49
icon : 'magentowidget' ,
41
50
tooltip : jQuery . mage . __ ( 'Insert Widget' ) ,
@@ -52,7 +61,10 @@ define([
52
61
* @param {ToolbarToggleButtonInstanceApi } api
53
62
*/
54
63
onSetup : function ( api ) {
55
- editor . on ( 'NodeChange' , ( e ) => {
64
+ /**
65
+ * NodeChange handler
66
+ */
67
+ editor . on ( 'NodeChange' , function ( e ) {
56
68
var placeholder = e . element ;
57
69
58
70
if ( self . isWidgetPlaceholderSelected ( placeholder ) ) {
0 commit comments