Edgewall Software
Modify

Opened 33 hours ago

Last modified 30 hours ago

#13784 assigned defect

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:
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 (1)

comment:1 by Jun Omae, 30 hours 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;

Modify Ticket

Change Properties
Set your email in Preferences
Action
as assigned The owner will remain Jun Omae.
The ticket will be disowned. Next status will be 'new'.
as The resolution will be set. Next status will be 'closed'.
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.