Changeset c2bed6 in indico


Ignore:
Timestamp:
06/03/10 18:50:25 (3 years ago)
Author:
Pedro Ferreira <jose.pedro.ferreira@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, new-webex, v0.97-series, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 4c7d4152dff271ba5df5a8606605969cab454080
Children:
30b4d4
Parents:
288781
git-author:
Ian Rolewicz <ian.rolewicz@…> (05/18/10 08:36:30)
git-committer:
Pedro Ferreira <jose.pedro.ferreira@…> (06/03/10 18:50:25)
Message:

[FIX] Timetable JS makes browser hang

  • fixes #394
  • An edge case in Draw.js (drawing a block of the timetable with a location displayed on two lines) made a statement in a while loop to be always true. This meant an infinite loop and the hanging of the browser
  • Added a condition in one of the other statements in order to catch this edge case.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • indico/htdocs/js/indico/Timetable/Draw.js

    r2d7696 rc2bed6  
    296296                    var locationMaxWidth = parentDivWidth  - 20; 
    297297 
    298                     // Hide the time if there are not enough space 
     298                    // Hide the time if there is not enough space 
    299299                    if (this.timeDiv.dom.offsetWidth + 8 >= parentDivWidth) { 
    300300                        this.timeDiv.dom.style.display = 'none'; 
    301301                    } 
    302                     else if (contentWidth() >= parentDivWidth) { 
     302                    // If at this point the width of the content fits but the height of the content 
     303                    // is bigger than the height of the parent div, it is probably because the 
     304                    // location takes more than one line in the block. For this edge case we force 
     305                    // the hiding of the time div so that the location div takes only one line. 
     306                    else if (contentWidth() >= parentDivWidth || contentHeight() >= parentDivHeight) { 
    303307                        this.timeDiv.dom.style.display = 'none'; 
    304308                    } else { 
     
    332336 
    333337                // Try to remove the location info, and set title font weight to non bold, 
    334                 // if this works then we're done otherwisestart to truncate the title as well. 
     338                // if this works, then we're done. Otherwise, start to truncate the title as well. 
    335339                if (this.timeDiv.dom.style.display == 'none') { 
    336340                    this.locationDiv.dom.style.display = 'none'; 
Note: See TracChangeset for help on using the changeset viewer.