@ -136,6 +136,7 @@ var ContextMenu = new Class({
@@ -136,6 +136,7 @@ var ContextMenu = new Class({
all _are _downloaded = true ;
all _are _paused = true ;
there _are _paused = false ;
all _are _super _seeding = true ;
var h = myTable . selectedIds ( ) ;
h . each ( function ( item , index ) {
@ -153,6 +154,8 @@ var ContextMenu = new Class({
@@ -153,6 +154,8 @@ var ContextMenu = new Class({
if ( data [ 'progress' ] != 1.0 ) // not downloaded
all _are _downloaded = false ;
else if ( data [ 'super_seeding' ] != true )
all _are _super _seeding = false ;
state = data [ 'state' ] ;
if ( ( state != 'pausedUP' ) && ( state != 'pausedDL' ) )
@ -174,6 +177,8 @@ var ContextMenu = new Class({
@@ -174,6 +177,8 @@ var ContextMenu = new Class({
if ( all _are _downloaded ) {
this . hideItem ( 'SequentialDownload' ) ;
this . hideItem ( 'FirstLastPiecePrio' ) ;
this . showItem ( 'SuperSeeding' ) ;
this . setItemChecked ( 'SuperSeeding' , all _are _super _seeding ) ;
} else {
if ( ! show _seq _dl && show _f _l _piece _prio )
this . menu . getElement ( 'a[href$=FirstLastPiecePrio]' ) . parentNode . addClass ( 'separator' ) ;
@ -192,6 +197,8 @@ var ContextMenu = new Class({
@@ -192,6 +197,8 @@ var ContextMenu = new Class({
this . setItemChecked ( 'SequentialDownload' , all _are _seq _dl ) ;
this . setItemChecked ( 'FirstLastPiecePrio' , all _are _f _l _piece _prio ) ;
this . hideItem ( 'SuperSeeding' ) ;
}
if ( all _are _paused ) {
@ -234,6 +241,10 @@ var ContextMenu = new Class({
@@ -234,6 +241,10 @@ var ContextMenu = new Class({
return this ;
} ,
getItemChecked : function ( item ) {
return '0' != this . menu . getElement ( 'a[href$=' + item + ']' ) . firstChild . style . opacity ;
} ,
//hide an item
hideItem : function ( item ) {
this . menu . getElement ( 'a[href$=' + item + ']' ) . parentNode . addClass ( 'invisible' ) ;