Modifications pour le document Icon
Modifié par Florent Charton le 2024/08/08 18:44
Depuis la version 1.1
modifié par Florent Charton
sur 2022/06/28 18:01
sur 2022/06/28 18:01
Commentaire de modification :
Install extension [org.xwiki.contrib:application-ckeditor-ui/1.64.2]
À la version 2.1
modifié par Florent Charton
sur 2024/08/08 18:44
sur 2024/08/08 18:44
Commentaire de modification :
Install extension [org.xwiki.platform:xwiki-platform-ckeditor-ui/15.10.11]
Résumé
-
Objets (1 modifications, 0 ajouts, 0 suppressions)
Détails
- XWiki.JavaScriptExtension[0]
-
- Code
-
... ... @@ -1,9 +1,17 @@ 1 1 require(['jquery', 'imageSelector'], function($, imageSelector) { 2 - $('#iconTab input[type="text"]').on('input', function () { 3 - if ($(this).val() === '') { 4 - imageSelector.updateSelectedImageReferences([]); 5 - } else { 6 - imageSelector.updateSelectedImageReferences([{type: 'icon', reference: $(this).val()}]); 7 - } 2 + function init(element) { 3 + element.find('.iconTab input[type="text"]').on('input', function () { 4 + if ($(this).val() === '') { 5 + imageSelector.updateSelectedImageReferences([], $(this)); 6 + } else { 7 + imageSelector.updateSelectedImageReferences([{type: 'icon', reference: $(this).val()}], $(this)); 8 + } 9 + }); 10 + } 11 + 12 + init($(document).find('.image-selector')); 13 + 14 + $(document).on('xwiki:dom:updated', (event, data) => { 15 + data.elements.forEach(element => init($(element))); 8 8 }); 9 9 });