Edgewall Software
Modify

Opened 2 months ago

Closed 3 weeks ago

#13784 closed defect (fixed)

wikiColumn in wiki.js makes forcibly the background of elements white

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.6.1
Component: wiki system Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:

Fixed the auto-centering of wikiColumn function in wiki.js.

  • Skip elements which have float: ..., position: absolute, position: fixed.
  • Add trac-wiki-center class instead of directly set the style of the elements.
  • The auto-centering doesn't work if enabling narrow when fullwidth is configured.
  • The auto-centering in narrow incorrectly effects print view.
API Changes:
Internal Changes:

Description

The div.wiki-toc that generated by PageOutline macro has #ffd (yellow) as background color. However, wikiColumn in wiki.js resets it to white with alpha 0.8 rgb(255, 255, 255, 0.8) or background: none.

I don't think it should reset the background color, instead, it should apply opacity: 0.8 and remove the applied styles.

  • trac/htdocs/js/wiki.js

    diff --git a/trac/htdocs/js/wiki.js b/trac/htdocs/js/wiki.js
    index d89ea9531..167b65819 100644
    a b  
    3939        if (shift_left > wpleft)
    4040          shift_left = wpleft;
    4141
    42         $e.css({'margin-left': -shift_left,
    43                 'background': 'rgba(255, 255, 255, .8)'});
     42        $e.css({'margin-left': -shift_left, 'opacity': '.8'});
    4443    };
    4544    var resetLargeElements = function() {
    46       for (var i = 0; i < large_elements.length; i++) {
    47         $(large_elements[i]).css({'margin-left': 0, 'background': 'none'});
    48       }
     45      $(large_elements).css({'margin-left': '', 'opacity': ''});
    4946    };
    5047    var detectLargeImage = function() {
    5148      var excess = detectLargeElement.apply(this);

Attachments (0)

Change History (2)

comment:1 by Jun Omae, 2 months ago

Also, elements which its float is not none like such .wiki-toc should be ignored.

  • trac/htdocs/js/wiki.js

    diff --git a/trac/htdocs/js/wiki.js b/trac/htdocs/js/wiki.js
    index d89ea9531..a0bb1d6e6 100644
    a b  
    1919    var wpow = $wikipage.outerWidth();
    2020    var large_elements = [];
    2121    var detectLargeElement = function() {
    22       var rol = $(this).offset().left - $wikipage.offset().left;
    23       var excess = $(this).outerWidth() + rol - wpow;
     22      var $e = $(this);
     23      if ($e.css('float') !== 'none')
     24        return -1;
     25      var rol = $e.offset().left - $wikipage.offset().left;
     26      var excess = $e.outerWidth() + rol - wpow;
    2427      if (excess > 0) {
    25         $(this).data('excess', excess);
    26         $(this).data('rol', rol);
     28        $e.data('excess', excess);
     29        $e.data('rol', rol);
    2730        large_elements.push(this);
    2831      }
    2932      return excess;

comment:2 by Jun Omae, 3 weeks ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

I fixed some issues in [17867] and merged in [17868]. See release notes field.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jun Omae to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.