Changeset 3768:42e99b4be675 for plugins/widgets/js
- Timestamp:
- 07/06/18 16:37:54 (7 years ago)
- Branch:
- default
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/widgets/js/widgets.js
r3709 r3768 13 13 title.empty().append(order).append(link).append(tools).append(br); 14 14 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(); 21 22 dotclear.viewPostContent($(this).parents('li')); 22 23 }; … … 25 26 dotclear.viewPostContent($(this).parents('li')); 26 27 }); 27 title.prepend( img);28 title.prepend(b); 28 29 }; 29 30 30 31 dotclear.viewPostContent = function(line, action) { 31 32 action = action || 'toogle'; 32 var img = line.find('. expand');33 var isopen = img.attr('a lt') == dotclear.img_plus_alt;33 var img = line.find('.details-cmd'); 34 var isopen = img.attr('aria-label') == dotclear.img_plus_alt; 34 35 35 36 if (action == 'close' || (action == 'toogle' && !isopen)) { 36 37 line.find('.widgetSettings').hide(); 37 img.attr(' src', dotclear.img_plus_src);38 img.attr('a lt', dotclear.img_plus_alt);38 img.attr('value', dotclear.img_plus_txt); 39 img.attr('aria-label', dotclear.img_plus_alt); 39 40 } else if (action == 'open' || (action == 'toogle' && isopen)) { 40 41 line.find('.widgetSettings').show(); 41 img.attr(' src', dotclear.img_minus_src);42 img.attr('a lt', dotclear.img_minus_alt);42 img.attr('value', dotclear.img_minus_txt); 43 img.attr('aria-label', dotclear.img_minus_alt); 43 44 } 44 45
Note: See TracChangeset
for help on using the changeset viewer.