Dotclear

Changeset 3768:42e99b4be675 for plugins


Ignore:
Timestamp:
07/06/18 16:37:54 (7 years ago)
Author:
franck <carnet.franck.paul@…>
Branch:
default
Message:

Switch from img to input for expanding/hiding various contents (posts, module details, …)

Location:
plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • plugins/blowupConfig/js/config.js

    r3709 r3768  
    6969  // Code import 
    7070  var e = $('#bu_export_content'); 
    71   e.toggle(); 
    7271 
    73   var img = document.createElement('img'); 
    74   img.src = dotclear.img_plus_src; 
    75   img.alt = dotclear.img_plus_alt; 
    76   img.className = 'expand'; 
    77   $(img).css('cursor', 'pointer'); 
    78   $(document.createTextNode(' ')).prependTo('#bu_export'); 
    79   $(img).prependTo('#bu_export'); 
    80  
    81   $(img).click(function() { 
    82     if (e.css('display') == 'none') { 
    83       this.src = dotclear.img_minus_src; 
    84       this.alt = dotclear.img_minus_alt; 
    85     } else { 
    86       this.src = dotclear.img_plus_src; 
    87       this.alt = dotclear.img_plus_alt; 
    88     } 
    89     e.toggle(); 
    90   }); 
     72  $('#bu_export').toggleWithLegend($(e),{ 
     73      legend_click: true 
     74  }) 
    9175 
    9276  var a = document.createElement('a'); 
  • plugins/widgets/js/widgets.js

    r3709 r3768  
    1313  title.empty().append(order).append(link).append(tools).append(br); 
    1414 
    15   var img = document.createElement('img'); 
    16   img.src = dotclear.img_plus_src; 
    17   img.alt = dotclear.img_plus_alt; 
    18   img.className = 'expand'; 
    19   $(img).css('cursor', 'pointer'); 
    20   img.onclick = function() { 
     15  var b = document.createElement('input'); 
     16  b.setAttribute('type', 'submit'); 
     17  b.className = 'details-cmd'; 
     18  b.value = dotclear.img_plus_txt; 
     19  b.setAttribute('aria-label', dotclear.img_plus_alt); 
     20  b.onclick = function(e) { 
     21    e.preventDefault(); 
    2122    dotclear.viewPostContent($(this).parents('li')); 
    2223  }; 
     
    2526    dotclear.viewPostContent($(this).parents('li')); 
    2627  }); 
    27   title.prepend(img); 
     28  title.prepend(b); 
    2829}; 
    2930 
    3031dotclear.viewPostContent = function(line, action) { 
    3132  action = action || 'toogle'; 
    32   var img = line.find('.expand'); 
    33   var isopen = img.attr('alt') == dotclear.img_plus_alt; 
     33  var img = line.find('.details-cmd'); 
     34  var isopen = img.attr('aria-label') == dotclear.img_plus_alt; 
    3435 
    3536  if (action == 'close' || (action == 'toogle' && !isopen)) { 
    3637    line.find('.widgetSettings').hide(); 
    37     img.attr('src', dotclear.img_plus_src); 
    38     img.attr('alt', dotclear.img_plus_alt); 
     38    img.attr('value', dotclear.img_plus_txt); 
     39    img.attr('aria-label', dotclear.img_plus_alt); 
    3940  } else if (action == 'open' || (action == 'toogle' && isopen)) { 
    4041    line.find('.widgetSettings').show(); 
    41     img.attr('src', dotclear.img_minus_src); 
    42     img.attr('alt', dotclear.img_minus_alt); 
     42    img.attr('value', dotclear.img_minus_txt); 
     43    img.attr('aria-label', dotclear.img_minus_alt); 
    4344  } 
    4445 
Note: See TracChangeset for help on using the changeset viewer.

Sites map