Merge branch '4.4' into master
[civicrm-core.git] / js / jquery / jquery.crmasmselect.js
index ffee488329987e11beefc1f2bc189b7ad3260faa..49b93e123987cf9c3c313c73c3958113d23429ec 100644 (file)
 
                                // select the firm item from the regular select that we created
 
-                               $select.children(":eq(0)").attr("selected", true); 
+                               $select.children(":eq(0)").prop("selected", true);
                        }
 
                        function disableSelectOption($option) {
                                // we apply a class that reproduces the disabled look in other browsers
 
                                $option.addClass(options.optionDisabledClass)
-                                       .attr("selected", false)
-                                       .attr("disabled", true);
+                                       .prop("selected", false)
+                                       .prop("disabled", true);
 
                                if(options.hideWhenAdded) $option.hide();
                                if($.browser.msie) $select.hide().show(); // this forces IE to update display
                                // given an already disabled select option, enable it
 
                                $option.removeClass(options.optionDisabledClass)
-                                       .attr("disabled", false);
+                                       .prop("disabled", false);
 
                                if(options.hideWhenAdded) $option.show();
                                if($.browser.msie) $select.hide().show(); // this forces IE to update display
 
                                if(!buildingSelect) {
                                        if($O.is(":selected")) return; // already have it
-                                       $O.attr('selected', true); 
+                                       $O.prop('selected', true);
                                }
 
                                if(options.addItemTarget == 'top' && !buildingSelect) {
                                if(highlightItem == undefined) var highlightItem = true; 
                                var $O = $('#' + optionId); 
 
-                               $O.attr('selected', false); 
+                               $O.prop('selected', false);
                                $item = $ol.children("li[rel=" + optionId + "]");
 
                                dropListItemHide($item);