Index: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js |
— | — | @@ -661,7 +661,6 @@ |
662 | 662 | }); |
663 | 663 | break; |
664 | 664 | case 'slider': |
665 | | - //var sliderId = _this.getClassId( this, 'slider_' ); |
666 | 665 | $j( this.selector + ' .slider_' + configKey ).slider({ |
667 | 666 | range: "min", |
668 | 667 | animate: true, |
— | — | @@ -670,10 +669,13 @@ |
671 | 670 | min: this.default_encoder_config[ configKey ].range.min, |
672 | 671 | max: this.default_encoder_config[ configKey ].range.max, |
673 | 672 | slide: function( event, ui ) { |
674 | | - $j( _this.selector + ' ._' + sliderId ).val( ui.value ); |
| 673 | + //cut of slider_ |
| 674 | + var configKey = _this.getClassId( this ).substr(7); |
675 | 675 | |
| 676 | + $j( _this.selector + ' ._' + configKey ).val( ui.value ); |
| 677 | + |
676 | 678 | // Maintain source video aspect ratio |
677 | | - if ( sliderId == 'width' ) { |
| 679 | + if ( configKey == 'width' ) { |
678 | 680 | var sourceHeight = _this.sourceFileInfo.video[0]['height']; |
679 | 681 | var sourceWidth = _this.sourceFileInfo.video[0]['width']; |
680 | 682 | var newHeight = parseInt( sourceHeight / sourceWidth * ui.value ); |
— | — | @@ -681,17 +683,19 @@ |
682 | 684 | if ( newHeight > _this.updateInterfaceValue( 'height', newHeight ) ) |
683 | 685 | return false; |
684 | 686 | } |
685 | | - if ( sliderId == 'height' ) { |
| 687 | + if ( configKey == 'height' ) { |
686 | 688 | var sourceHeight = _this.sourceFileInfo.video[0]['height']; |
687 | 689 | var sourceWidth = _this.sourceFileInfo.video[0]['width']; |
688 | 690 | var newWidth = parseInt( sourceWidth / sourceHeight * ui.value ); |
689 | 691 | // Reject the update if the new width is above the maximum |
690 | | - if ( newWidth > _this.updateInterfaceValue( 'width', wv ) ) |
| 692 | + if ( newWidth > _this.updateInterfaceValue( 'width', newWidth ) ) |
691 | 693 | return false; |
692 | 694 | } |
693 | 695 | }, |
694 | 696 | change: function( event, ui ) { |
695 | | - _this.updateLocalValue( sliderId, ui.value ); |
| 697 | + //cut of slider_ |
| 698 | + var configKey = _this.getClassId( this ).substr(7); |
| 699 | + _this.updateLocalValue( configKey, ui.value ); |
696 | 700 | _this.updatePresetSelection( 'custom' ); |
697 | 701 | } |
698 | 702 | }); |