File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
app/code/Magento/Ui/view/base/web/js/form/element
lib/internal/Magento/Framework/Data/Form/Element Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ define([
20
20
return Abstract . extend ( {
21
21
defaults : {
22
22
elementSelector : 'textarea' ,
23
+ suffixRegExpPattern : '\\${ \\$.wysiwygUniqueSuffix }' ,
23
24
value : '' ,
24
25
$wysiwygEditorButton : '' ,
25
26
links : {
@@ -61,12 +62,23 @@ define([
61
62
return this ;
62
63
} ,
63
64
65
+ /** @inheritdoc */
66
+ initConfig : function ( config ) {
67
+ var pattern = config . suffixRegExpPattern || this . constructor . defaults . suffixRegExpPattern ;
68
+
69
+ config . content = config . content . replace ( new RegExp ( pattern , 'g' ) , this . getUniqueSuffix ( config ) ) ;
70
+ this . _super ( ) ;
71
+
72
+ return this ;
73
+ } ,
74
+
64
75
/**
65
- * @inheritdoc
76
+ * Build unique id based on name, underscore separated.
77
+ *
78
+ * @param {Object } config
66
79
*/
67
- destroy : function ( ) {
68
- this . _super ( ) ;
69
- wysiwyg . removeEvents ( this . wysiwygId ) ;
80
+ getUniqueSuffix : function ( config ) {
81
+ return config . name . replace ( / ( \. | - ) / g, '_' ) ;
70
82
} ,
71
83
72
84
/**
Original file line number Diff line number Diff line change @@ -542,4 +542,12 @@ protected function getInlineJs($jsSetupObject, $forceLoad)
542
542
</script> ' ;
543
543
return $ jsString ;
544
544
}
545
+
546
+ /**
547
+ * @inheritdoc
548
+ */
549
+ public function getHtmlId ()
550
+ {
551
+ return parent ::getHtmlId () . '${ $.wysiwygUniqueSuffix } ' ;
552
+ }
545
553
}
You can’t perform that action at this time.
0 commit comments