@@ -253,9 +253,10 @@ $.widget("ui.selectmenu", {
253
253
// this allows for using the scrollbar in an overflowed list
254
254
. bind ( 'mousedown.selectmenu mouseup.selectmenu' , function ( ) { return false ; } ) ;
255
255
256
-
257
256
// needed when window is resized
258
- $ ( window ) . bind ( "resize.selectmenu" , $ . proxy ( self . _refreshPosition , this ) ) ;
257
+ // TODO seems to be useless, but causes errors (fnagel 01.08.11)
258
+ // see: https://github.com/fnagel/jquery-ui/issues/147
259
+ // $(window).bind( "resize.selectmenu", $.proxy( self._refreshPosition, this ) );
259
260
} ,
260
261
261
262
_init : function ( ) {
@@ -424,7 +425,8 @@ $.widget("ui.selectmenu", {
424
425
. removeAttr ( 'aria-disabled' )
425
426
. unbind ( ".selectmenu" ) ;
426
427
427
- $ ( window ) . unbind ( ".selectmenu" ) ;
428
+ // TODO unneded as event binding has been disabled
429
+ // $( window ).unbind( ".selectmenu" );
428
430
$ ( document ) . unbind ( ".selectmenu" ) ;
429
431
430
432
// unbind click on label, reset its for attr
@@ -513,21 +515,26 @@ $.widget("ui.selectmenu", {
513
515
var self = this , o = this . options ;
514
516
if ( self . newelement . attr ( "aria-disabled" ) != 'true' ) {
515
517
self . _closeOthers ( event ) ;
516
- self . newelement
517
- . addClass ( 'ui-state-active' ) ;
518
+ self . newelement . addClass ( 'ui-state-active' ) ;
518
519
519
520
self . listWrap . appendTo ( o . appendTo ) ;
520
-
521
- self . listWrap . addClass ( self . widgetBaseClass + '-open' ) ;
522
-
523
- selected = self . list . attr ( 'aria-hidden' , false ) . find ( 'li:not(.' + self . widgetBaseClass + '-group):eq(' + self . _selectedIndex ( ) + ') a' ) ;
524
- if ( selected . length ) selected [ 0 ] . focus ( ) ;
521
+ self . list . attr ( 'aria-hidden' , false )
525
522
526
523
if ( o . style == "dropdown" ) {
527
524
self . newelement . removeClass ( 'ui-corner-all' ) . addClass ( 'ui-corner-top' ) ;
528
525
}
529
526
530
- self . _refreshPosition ( ) ;
527
+ self . listWrap . addClass ( self . widgetBaseClass + '-open' ) ;
528
+ // positioning needed for IE7 (tested 01.08.11 on MS VPC Image)
529
+ // see https://github.com/fnagel/jquery-ui/issues/147
530
+ if ( $ . browser . msie && $ . browser . version . substr ( 0 , 1 ) == 7 ) {
531
+ self . _refreshPosition ( ) ;
532
+ }
533
+ selected = self . list . attr ( 'aria-hidden' , false ) . find ( 'li:not(.' + self . widgetBaseClass + '-group):eq(' + self . _selectedIndex ( ) + ') a' ) ;
534
+ if ( selected . length ) selected [ 0 ] . focus ( ) ;
535
+ // positioning needed for FF, Chrome, IE8, IE7, IE6 (tested 01.08.11 on MS VPC Image)
536
+ self . _refreshPosition ( ) ;
537
+
531
538
self . _trigger ( "open" , event , self . _uiHash ( ) ) ;
532
539
}
533
540
} ,
@@ -794,6 +801,7 @@ $.widget("ui.selectmenu", {
794
801
795
802
_refreshPosition : function ( ) {
796
803
var o = this . options ;
804
+
797
805
// if its a native pop-up we need to calculate the position of the selected li
798
806
if ( o . style == "popup" && ! o . positionOptions . offset ) {
799
807
var selected = this . _selectedOptionLi ( ) ;
@@ -807,13 +815,13 @@ $.widget("ui.selectmenu", {
807
815
} ) ;
808
816
}
809
817
this . listWrap . position ( {
810
- // set options for position plugin
811
- of : o . positionOptions . of || this . newelement ,
812
- my : o . positionOptions . my ,
813
- at : o . positionOptions . at ,
814
- offset : o . positionOptions . offset || _offset ,
815
- collision : o . positionOptions . collision || 'flip'
816
- } ) ;
818
+ // set options for position plugin
819
+ of : o . positionOptions . of || this . newelement ,
820
+ my : o . positionOptions . my ,
821
+ at : o . positionOptions . at ,
822
+ offset : o . positionOptions . offset || _offset ,
823
+ collision : o . positionOptions . collision || 'flip'
824
+ } ) ;
817
825
}
818
826
} ) ;
819
827
0 commit comments