Changeset 23ec10 in indico


Ignore:
Timestamp:
04/05/11 13:22:30 (2 years ago)
Author:
Jose Benito <jose.benito.gonzalez@…>
Branches:
master, burotel, hello-world-walkthrough, ipv6, v0.98-series, v0.98.2, v0.98.3, v0.98b1, v0.98b2, v0.99, 051b2622c51afb171a1dedb46a0df4fbb0cbd02e, 0da0c1403bae8e51d8229f460181c71b9e6dda72
Children:
2b11e5
Parents:
cf4381
git-author:
Adrian Moennich <jerome.ernst.monnich@…> (04/05/11 12:29:06)
git-committer:
Jose Benito <jose.benito.gonzalez@…> (04/05/11 13:22:30)
Message:

[FIX] only apply width fix for popups

Location:
indico/htdocs/js/indico/Core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • indico/htdocs/js/indico/Core/Dialogs/Popup.js

    r9c17bf r23ec10  
    11type("PopupDialog", ["PopupWidget"], { 
    22    draw: function(content, x, y) { 
    3         return this.PopupWidget.prototype.draw.call(this, content, x, y); 
     3        return this.PopupWidget.prototype.draw.call(this, content, x, y, null, true); 
    44    }, 
    55 
     
    121121 
    122122 
    123         return this.PopupWidget.prototype.draw.call(this, this.container, 0, 0); 
     123        return this.PopupWidget.prototype.draw.call(this, this.container, 0, 0, null, true); 
    124124    }, 
    125125 
  • indico/htdocs/js/indico/Core/Widgets/Base.js

    rcf4381 r23ec10  
    878878 
    879879type("PopupWidget", [], { 
    880     draw: function(content, x, y, styles) { 
     880    draw: function(content, x, y, styles, setWidth) { 
    881881        var self = this; 
    882882 
     
    893893        } 
    894894 
    895         // taken from jQuery width() function. TODO: replace with less-ugly code as soon as we have jquery embedded globally 
    896         var width = ('scrollTo' in document && document) ? 
    897                 document.compatMode === "CSS1Compat" && document.documentElement.clientWidth || document.body.clientWidth : 
    898                 Math.max(document.documentElement.clientWidth, document.body.scrollWidth, document.documentElement.scrollWidth, 
    899                          document.body.offsetWidth, document.documentElement.offsetWidth); 
    900         width -= x; 
    901895        styles = any(styles, { 
    902896            // If the canvas has been set to fixed position don't change it 
    903897            position: this.canvas.dom.style.position == 'fixed' ? 'fixed' : 'absolute', 
    904898            left: pixels(x), 
    905             top: pixels(y), 
    906             width: pixels(width) 
     899            top: pixels(y) 
    907900        }); 
     901 
     902        if(setWidth) { 
     903            // taken from jQuery width() function. TODO: replace with less-ugly code as soon as we have jquery embedded globally 
     904            var width = ('scrollTo' in document && document) ? 
     905                    document.compatMode === "CSS1Compat" && document.documentElement.clientWidth || document.body.clientWidth : 
     906                    Math.max(document.documentElement.clientWidth, document.body.scrollWidth, document.documentElement.scrollWidth, 
     907                             document.body.offsetWidth, document.documentElement.offsetWidth); 
     908            width -= x; 
     909            styles.width = pixels(width); 
     910        } 
    908911 
    909912        each(styles, function(value, key) { 
Note: See TracChangeset for help on using the changeset viewer.