Projet

Général

Profil

0001-misc-make-inserting-select2.js-bring-its-dependencie.patch

Frédéric Péters, 20 octobre 2020 09:22

Télécharger (1,75 ko)

Voir les différences:

Subject: [PATCH] misc: make inserting select2.js bring its dependencies
 (#47867)

 wcs/qommon/form.py          | 3 +--
 wcs/qommon/http_response.py | 3 +++
 2 files changed, 4 insertions(+), 2 deletions(-)
wcs/qommon/form.py
1809 1809

  
1810 1810
    def add_media(self):
1811 1811
        if self.select2:
1812
            get_response().add_javascript(['jquery.js', '../../i18n.js', 'qommon.forms.js', 'select2.js'])
1813
            get_response().add_css_include('../js/select2/select2.css')
1812
            get_response().add_javascript(['select2.js'])
1814 1813

  
1815 1814
    def separate_hint(self):
1816 1815
        return (self.hint and len(self.hint) > 80)
wcs/qommon/http_response.py
110 110
                    self.add_javascript(['../../i18n.js', 'jquery.js', 'jquery-ui.js'])
111 111
                if script_name == 'qommon.admin.js':
112 112
                    self.add_javascript(['../../i18n.js', 'jquery.js', 'qommon.slugify.js'])
113
                if script_name == 'select2.js':
114
                    self.add_javascript(['jquery.js', '../../i18n.js', 'qommon.forms.js', 'select2.js'])
115
                    self.add_css_include('../js/select2/select2.css')
113 116

  
114 117
    def add_javascript_code(self, code):
115 118
        if not self.javascript_code_parts:
116
-