@@ -54,21 +54,19 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
5454
5555 if ( this . drag ) {
5656 params = this . href . split ( '|' ) ;
57- n = parseInt ( params [ 1 ] , 10 ) - 1 ;
58-
57+ n = parseInt ( params [ 1 ] , 10 ) - 1 ;
5958 this . speciesPath = params [ 3 ] . replace ( / - / , '/' ) ;
6059 this . species = this . speciesPath . split ( '/' ) . pop ( ) ;
6160 this . chr = params [ 4 ] ;
6261 this . start = parseInt ( params [ 5 ] , 10 ) ;
6362 this . end = parseInt ( params [ 6 ] , 10 ) ;
6463 this . strand = parseInt ( params [ 7 ] , 10 ) ;
6564 this . multi = area . klass . multi ? n : false ;
66-
6765 if ( ! this . speciesPath . match ( / ^ \/ / ) ) {
6866 this . speciesPath = '/' + this . speciesPath ;
6967 }
7068 }
71-
69+
7270 area = null ;
7371
7472 delete this . areaCoords . a ;
@@ -122,7 +120,7 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
122120
123121 // The location parameter that is due to be changed has its value replaced with %s
124122 this . baseURL = window . location . href . replace ( / & / g, ';' ) . replace ( / # .* $ / g, '' ) . replace ( r , '$1%s;' ) . replace ( / [ \? ; ] $ / g, '' ) ;
125-
123+
126124 // Add r parameter if it doesn't exist already
127125 if ( ! this . baseURL . match ( / % s / ) ) {
128126 this . baseURL += ( this . baseURL . match ( / \? / ) ? ';' : '?' ) + 'r=%s' ;
@@ -378,7 +376,7 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
378376 var scale = ( max - min + 1 ) / ( this . areaCoords . r - this . areaCoords . l ) ;
379377 var url = this . baseURL ;
380378 var menu , caption , start , end , tmp , cls ;
381-
379+
382380 // Gene, transcript views
383381 function notLocation ( ) {
384382 var view = end - start + 1 > Ensembl . maxRegionLength ? 'Overview' : 'View' ;
@@ -405,7 +403,8 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
405403 var label = start ? 'region' : 'location' ;
406404 label += panel . species === Ensembl . species ? '' : ' on ' + Ensembl . species . replace ( / _ / g, ' ' ) ;
407405
408- menu = [ '<a href="' + url . replace ( / % s / , Ensembl . coreParams . r + ';align_start=' + start + ';align_end=' + end ) + '">Jump to best aligned ' + label + '</a>' ] ;
406+ menu = [ '<a class="loc-icon-a" href="' + url . replace ( / % s / , Ensembl . coreParams . r + ';align_start=' + start + ';align_end=' + end ) +
407+ '"><span class="loc-icon loc-change"></span>Jump to best aligned ' + label + '</a>' ] ;
409408 caption = 'Alignment: ' + ( start ? start + '-' + end : panel . location ) ;
410409 }
411410
@@ -432,13 +431,12 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
432431 start = this . end + this . start - end ;
433432 end = this . end + this . start - tmp ;
434433 }
435-
436- if ( this . align === true ) {
434+
435+ if ( this . align ) {
437436 align ( ) ;
438437 } else {
439438 url = url . replace ( / % s / , this . chr + ':' + start + '-' + end ) ;
440439 caption = 'Region: ' + this . chr + ':' + start + '-' + end ;
441-
442440 if ( ! locationView ) {
443441 notLocation ( ) ;
444442 } else if ( this . multi !== false ) {
@@ -457,14 +455,15 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
457455 }
458456 }
459457
460- if ( this . multi === false ) {
461- menu . unshift ( '<a class="_location_mark loc-icon-a" href="' + Ensembl . updateURL ( { mr : this . chr + ':' + start + '-' + end } , window . location . href ) + '"><span class="loc-icon loc-mark"></span>Mark region (' + ( end - start + 1 ) + ' bp)</a>' ) ;
458+ if ( this . multi === false && ! this . align ) {
459+ var no_bases = ' (' + ( end - start + 1 ) + ' bp)' ;
460+ menu . unshift ( '<a class="_location_mark loc-icon-a" href="' + '"><span class="loc-icon loc-mark"></span>Mark region' + no_bases + '</a>' ) ;
462461 }
463462
464463 } else { // Point select
465464 this . location = Math . floor ( min + ( this . coords . x - this . areaCoords . l ) * scale ) ;
466465
467- if ( this . align === true ) {
466+ if ( this . align ) {
468467 url = this . zoomURL ( 1 / 10 ) ;
469468 align ( ) ;
470469 } else {
@@ -608,7 +607,7 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
608607 start = this . start ;
609608 }
610609
611- if ( this . align === true ) {
610+ if ( this . align ) {
612611 return this . baseURL . replace ( / % s / , Ensembl . coreParams . r + ';align_start=' + start + ';align_end=' + end ) ;
613612 } else {
614613 return this . baseURL . replace ( / % s / , ( this . chr || Ensembl . location . name ) + ':' + start + '-' + end ) ;
@@ -652,7 +651,6 @@ Ensembl.Panel.ZMenu = Ensembl.Panel.extend({
652651 showExisting : function ( data ) {
653652 this . event = data . event ;
654653 this . coords = data . coords ;
655-
656654 if ( this . group || this . drag || this . event . shiftKey ) {
657655 if ( this . elLk . header ) {
658656 this . elLk . header . remove ( ) ;
0 commit comments