ep_comments_page 11.0.33 → 11.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "description": "Adds comments on sidebar and link it to the text. For no-skin use ep_page_view.",
3
3
  "name": "ep_comments_page",
4
- "version": "11.0.33",
4
+ "version": "11.0.34",
5
5
  "author": {
6
6
  "name": "Nicolas Lescop",
7
7
  "email": "limplementeur@gmail.com"
@@ -247,16 +247,22 @@ EpComments.prototype.init = async function () {
247
247
  // Listen for include suggested change toggle
248
248
  this.container.parent().on('change', '.suggestion-checkbox', function () {
249
249
  const parentComment = $(this).closest('.comment-container');
250
- const parentSuggest = $(this).closest('.comment-reply');
250
+ const parentSuggest = $(this).closest('.comment-reply, .new-comment-popup');
251
251
 
252
252
  if ($(this).is(':checked')) {
253
253
  const commentId = parentComment.data('commentid');
254
254
  const padOuter = $('iframe[name="ace_outer"]').contents();
255
255
  const padInner = padOuter.find('iframe[name="ace_inner"]');
256
256
 
257
- const currentString = padInner.contents().find(`.${commentId}`).html();
257
+ const currentString = padInner.contents().find(`.${commentId}`).text();
258
258
 
259
259
  parentSuggest.find('.from-value').html(currentString);
260
+ // Update l10n args so the translated label shows the actual selected text
261
+ const fromLabel = parentSuggest.find('.suggestion-create .from-label')[0];
262
+ if (fromLabel) {
263
+ fromLabel.dataset.l10nArgs = JSON.stringify({changeFrom: currentString || ''});
264
+ html10n.translateElement(html10n.translations, fromLabel);
265
+ }
260
266
  parentSuggest.find('.suggestion').show();
261
267
  } else {
262
268
  parentSuggest.find('.suggestion').hide();