Projet

Général

Profil

0001-misc-add-possibility-to-mark-popup-links-with-data-p.patch

Frédéric Péters, 27 février 2020 18:08

Télécharger (1,65 ko)

Voir les différences:

Subject: [PATCH] misc: add possibility to mark popup links with data-popup
 (#40247)

 wcs/qommon/static/js/popup.js | 2 +-
 wcs/qommon/template.py        | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)
wcs/qommon/static/js/popup.js
44 44
}
45 45

  
46 46
$(function() {
47
    $('a[rel=popup]').click(displayPopup);
47
    $('a[rel=popup], a[data-popup]').click(displayPopup);
48 48
    $(document).on('wcs:dialog-loaded', function(e, dialog) {
49 49
        if ($(dialog).find('input[name$=add_element]').length) {
50 50
            prepare_widget_list_elements();
wcs/qommon/template.py
263 263
    if 'lang' not in kwargs and hasattr(get_request(), 'language'):
264 264
        response.filter['lang'] = get_request().language
265 265

  
266
    if 'rel="popup"' in body or 'rel="popup"' in kwargs.get('sidebar', ''):
266
    if ('rel="popup"' in body or 'rel="popup"' in kwargs.get('sidebar', '')) or (
267
            'data-popup' in body or 'data-popup' in kwargs.get('sidebar', '')):
267 268
        response.add_javascript(['jquery.js', 'jquery-ui.js', 'popup.js', 'widget_list.js'])
268 269

  
269 270
    onload = kwargs.get('onload')
270
-