Changeset 5313
- Timestamp:
- Apr 16, 2010, 8:36:35 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.15-stable/www/include/scripts/main.js
r5288 r5313 2770 2770 { 2771 2771 this.tags = Main.getElementsByTagAndClassName(tagName, className); 2772 if (this.tags.length > 300)2773 {2774 this.checkAllDelayed();2775 return;2776 }2777 if (Browser.isIE)2778 {2779 document.body.style.display = 'none';2780 }2781 2772 for (var i = 0; i < this.tags.length; i++) 2782 2773 { 2783 2774 this.checkTag(this.tags[i]); 2784 2775 } 2785 if (Browser.isIE) 2786 { 2787 document.body.style.display = 'block'; 2788 } 2789 } 2790 2791 this.checkAllDelayed = function() 2792 { 2793 var self = this; 2794 var f = function() 2795 { 2796 if (self.checkNextTag()) setTimeout(f, 5); 2797 }; 2798 setTimeout(f, 5); 2799 } 2800 2801 this.checkNextTag = function() 2802 { 2803 if (this.tags.length <= this.nextTag) return false; 2804 this.checkTag(this.tags[this.nextTag]); 2805 this.nextTag++; 2806 return true; 2776 for (var i = 0; i < this.tags.length; i++) 2777 { 2778 this.fixTag(this.tags[i]); 2779 } 2807 2780 } 2808 2781 … … 2811 2784 var isWidthOverflowed = tag.clientWidth < tag.scrollWidth; 2812 2785 var isHeightOverflowed = tag.clientHeight +5 < tag.scrollHeight; 2813 var isOverflowed = isWidthOverflowed || isHeightOverflowed; 2814 2786 //alert("checkTag: " + tag + ':' + ':' + tag.clientWidth + ':' + tag.scrollWidth + ':' + tag.clientHeight + ':' + tag.scrollHeight); 2787 tag.isWidthOverflowed = isWidthOverflowed; 2788 tag.isHeightOverflowed = isHeightOverflowed; 2789 tag.isOverflowed = isWidthOverflowed || isHeightOverflowed; 2790 } 2791 2792 this.fixTag = function(tag) 2793 { 2815 2794 var className = 'constrained'; 2816 if ( isOverflowed)2795 if (tag.isOverflowed) 2817 2796 { 2818 2797 className += ' overflowed'; 2819 tag.isWidthOverflowed = isWidthOverflowed;2820 tag.isHeightOverflowed = isHeightOverflowed;2821 2798 var self = this; 2822 2799 var onClickListener = function() { self.showOverflowedText(tag); };
Note: See TracChangeset
for help on using the changeset viewer.