Changeset 8504
- Timestamp:
- May 24, 2009, 12:02:43 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/web/javascript/torrent.js
r8503 r8504 646 646 this._dirty = true; 647 647 this._torrent = file_data.torrent; 648 this._index = file_data.index; 648 649 var pos = file_data.name.indexOf('/'); 649 650 if (pos >= 0) … … 654 655 655 656 var li = document.createElement('li'); 657 li.classNameConst = 'inspector_torrent_file_list_entry ' + ((this._index%2)?'odd':'event'); 658 li.className = li.classNameConst; 656 659 657 660 var wanted_div = document.createElement('div'); … … 659 662 660 663 var pri_div = document.createElement('div'); 661 pri_div.className = "file_priority_control"; 664 pri_div.classNameConst = "file_priority_control"; 665 pri_div.className = pri_div.classNameConst; 662 666 663 667 var file_div = document.createElement('div'); … … 674 678 675 679 this._element = li; 676 this._priority_control = $(pri_div);680 this._priority_control = pri_div; 677 681 this._progress = $(prog_div); 678 682 679 683 $(wanted_div).bind('click', { file: this }, this.fileWantedControlClicked); 680 this._priority_control.bind('click', { file: this }, this.filePriorityControlClicked);684 $(pri_div).bind('click', { file: this }, this.filePriorityControlClicked); 681 685 }, 682 686 … … 758 762 759 763 refreshWantedHTML: function() { 760 var element = this.element(); 761 var c = element[0].className.replace(/ skip| complete/g, '').split(' '); 762 763 if(!this._wanted) 764 c.push('skip'); 765 if(this._done>=this._size) 766 c.push('complete'); 767 768 element[0].className = c.join(' '); 764 var e = this.element()[0]; 765 var c = e.classNameConst; 766 if(!this._wanted) c += ' skip'; 767 if(this._done>=this._size) c += ' complete'; 768 e.className = c; 769 769 }, 770 770 771 771 refreshPriorityHTML: function() { 772 var priority = { '1': 'high', '0': 'normal', '-1': 'low' }[new String(this._prio)]; 773 var c = this._priority_control[0].className.replace(/ high| normal| low/g, '').split(' '); 774 775 c.push(priority) 776 this._priority_control[0].className = class.join(' '); 772 var e = this._priority_control; 773 var c = e.classNameConst; 774 switch( this._prio ) { 775 case 1: c += ' high'; break; 776 case -1: c += ' low'; break; 777 default: c += ' normal'; break; 778 } 779 e.className = c; 777 780 }, 778 781
Note: See TracChangeset
for help on using the changeset viewer.