http://www.mediawiki.org/wiki/Special:Code/MediaWiki/66641

Revision: 66641
Author:   j
Date:     2010-05-19 11:19:43 +0000 (Wed, 19 May 2010)

Log Message:
-----------
FirefoggGUI fixes
- fix slider slide and change function, configKey needs to be parsed from 
current element.
- use newWidth instead of undefined variable as default in aspect raio check

Modified Paths:
--------------
    branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js

Modified: branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js
===================================================================
--- branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js      
2010-05-19 08:48:44 UTC (rev 66640)
+++ branches/js2-work/phase3/js/mwEmbed/modules/AddMedia/mw.FirefoggGUI.js      
2010-05-19 11:19:43 UTC (rev 66641)
@@ -661,7 +661,6 @@
                                        });
                                        break;
                                case 'slider':
-                                       //var sliderId = _this.getClassId( 
this, 'slider_' );
                                        $j( this.selector + ' .slider_' + 
configKey ).slider({
                                                range: "min",
                                                animate: true,
@@ -670,10 +669,13 @@
                                                min: 
this.default_encoder_config[ configKey ].range.min,
                                                max: 
this.default_encoder_config[ configKey ].range.max,
                                                slide: function( event, ui ) {
-                                                       $j( _this.selector + ' 
._' + sliderId ).val( ui.value );
+                                               //cut of slider_
+                                               var configKey = 
_this.getClassId( this ).substr(7);
 
+                                                       $j( _this.selector + ' 
._' + configKey ).val( ui.value );
+
                                                        // Maintain source 
video aspect ratio
-                                                       if ( sliderId == 
'width' ) {
+                                                       if ( configKey == 
'width' ) {
                                                                var 
sourceHeight = _this.sourceFileInfo.video[0]['height'];
                                                                var sourceWidth 
= _this.sourceFileInfo.video[0]['width'];
                                                                var newHeight = 
parseInt( sourceHeight / sourceWidth * ui.value );
@@ -681,17 +683,19 @@
                                                                if ( newHeight 
> _this.updateInterfaceValue( 'height', newHeight ) )
                                                                        return 
false;
                                                        }
-                                                       if ( sliderId == 
'height' ) {
+                                                       if ( configKey == 
'height' ) {
                                                                var 
sourceHeight = _this.sourceFileInfo.video[0]['height'];
                                                                var sourceWidth 
= _this.sourceFileInfo.video[0]['width'];
                                                                var newWidth = 
parseInt( sourceWidth / sourceHeight * ui.value );
                                                                // Reject the 
update if the new width is above the maximum
-                                                               if ( newWidth > 
_this.updateInterfaceValue( 'width', wv ) )
+                                                               if ( newWidth > 
_this.updateInterfaceValue( 'width', newWidth ) )
                                                                        return 
false;
                                                        }
                                                },
                                                change: function( event, ui ) {
-                                                       _this.updateLocalValue( 
sliderId, ui.value );
+                                               //cut of slider_
+                                               var configKey = 
_this.getClassId( this ).substr(7);
+                                                       _this.updateLocalValue( 
configKey, ui.value );
                                                        
_this.updatePresetSelection( 'custom' );
                                                }
                                        });



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to