[TikiWiki-commits] [Git][tikiwiki/tiki][27.x] [BP][REF] Tracker Icon Field: use BS Modal for picking icons instead jQuery UI Dialog

"luci \(@luciash\) via TikiWiki-cvs" <[email protected]>
Newsgroups gmane.comp.cms.tiki.cvs
Message-ID <699743765a145_3bc80e9c736d3@gitlab-sidekiq-low-urgency-cpu-bound-v2-9fdfc94f7-d9bd2.mail>

luci pushed to branch 27.x at Tiki Wiki CMS Groupware / Tiki


Commits:
68cb7b6f by luci at 2026-02-19T16:59:54+00:00
[BP][REF] Tracker Icon Field: use BS Modal for picking icons instead jQuery UI Dialog
---
* [REF] Tracker Icon Field: use BS Modal for picking icons instead jQuery UI Dialog


(cherry picked from commit 13a75b31893c9c597d21b809fa24a071488295ce)

Co-authored-by: Merci Jacob <[email protected]>

See merge request tikiwiki/tiki!9613

- - - - -


1 changed file:

- templates/trackerinput/icon.tpl


Changes:

=====================================
templates/trackerinput/icon.tpl
=====================================
@@ -1,6 +1,6 @@
 <div class="icon-selector-container">
     <input type="hidden" name="{$field.ins_id|escape}" value="{$field.value|escape}">
-    <img class="icon" src="{$field.value|escape}" alt="{tr}Select Icon{/tr}">
+    <img class="icon" src="{$field.value|escape}" role="button" alt="{tr}Select Icon{/tr}">
     <div class="selector" style="display: none;">
         <div class="sections" style="float: left; width: 25%;">
             <ul class="list-group pe-3">
@@ -19,48 +19,44 @@
 {jq}
     {literal}
     $('.icon-selector-container').removeClass('icon-selector-container').each(function () {
-        var icon = $('.icon', this).button();
-        var field = $(':input', this);
-        var jqxhr;
-        var selector = $('.selector', this)
-            .dialog({
+        const icon = $('.icon', this);
+        const field = $(':input', this);
+        let jqxhr;
+        icon.on("click", () => {
+             $.openModal({
                 title: icon.attr('alt'),
-                width: 600,
-                autoOpen: false,
-                modal: true,
-                open: function () { $(document).trigger('iconsloaded'); }
-            })
-            .each(function () {
-                var contents = $('.contents', this);
-                $('.buttons', this).buttonset();
-                $('.sections a', this).css('display', 'block').on("click",function () {
-                    contents.empty().append($('{/literal}{icon name='spinner' iclass='fa-spin'}{literal}'));
-                    if (jqxhr) {
-                        jqxhr.abort();
-                    }
-                    jqxhr = $.getJSON($(this).attr('href'), function (data) {
-                        jqxhr = null;
-                        contents.empty();
-                        $.each(data.result, function (k, v) {
-                            var link = $(v.link);
-                            link.attr('title', tr(v.title));
-                            link.empty().append($('<img/>').attr('src', link.attr('href')));
-                            link.on("click", function () {
-                                field.val($(this).attr('href'));
-                                icon.attr('src', $(this).attr('href'));
-                                selector.dialog('close');
-                                return false;
-                            });
+                size: 'modal-lg',
+                dialogVariants: ['scrollable'],
+                content: $('.selector', this).html(),
+                open: function () {
+                    const contents = $('.contents', this);
+                    $('.sections a', this).css('display', 'block').on("click",function () {
+                        contents.empty().append($('{/literal}{icon name='spinner' iclass='fa-spin'}{literal}'));
+                        if (jqxhr) {
+                            jqxhr.abort();
+                        }
+                        jqxhr = $.getJSON($(this).attr('href'), function (data) {
+                            jqxhr = null;
+                            contents.empty();
+                            $.each(data.result, function (k, v) {
+                                const link = $(v.link);
+                                link.attr('title', tr(v.title));
+                                link.empty().append($('<img/>').attr('src', link.attr('href')));
+                                link.on("click", function () {
+                                    field.val($(this).attr('href'));
+                                    icon.attr('src', $(this).attr('href'));
+                                    $.closeModal();
+                                    return false;
+                                });
 
-                            link.appendTo(contents);
+                                link.appendTo(contents);
+                            });
                         });
+                        return false;
                     });
-                    return false;
-                });
-                $('.sections a:first', this).trigger("click");
-            });
-        icon.on("click", function () {
-            selector.dialog('open');
+                    $('.sections a:first', this).trigger("click");
+                }
+             })
         });
     });
     {/literal}



View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/68cb7b6f3c0cbfc1b99791d4e595e83c2798bd36

-- 
View it on GitLab: https://gitlab.com/tikiwiki/tiki/-/commit/68cb7b6f3c0cbfc1b99791d4e595e83c2798bd36
You're receiving this email because of your account on gitlab.com. Manage all notifications: https://gitlab.com/-/profile/notifications | Help: https://gitlab.com/help

_______________________________________________
TikiWiki-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.