Bug Tracker

Custom Query (13852 matches)

Filters
 
Or
 
  
 
Columns

Show under each result:


Results (64 - 66 of 13852)

Ticket Resolution Summary Owner Reporter
#70 fixed Add an merge object method to jQuery core Jörn
Description

I saw the idea of merging objects to overwrite default options some time ago in a plugin...

Many plugins have default values that can be overwritten by the client. A convienent approach is to use an object literal to define defaults and merge the defaults with options given by the client.

Example:

defaults = {
  option1: 1,
  option2: "foo"
}
options = {
  option2: "bar"
}
// merge these
$.mergeObject(defaults, options);

// Would result in options being unchanged an
// defaults with option1 equals 1 
// and option2 equals "bar"

The mergeObject function is very small:

/**
 * Merges two objects, overwriting all properties
 * of the defaults with properties from
 * the options, if present.
 */
jQuery.mergeOptions = function(defaults, options) {
	for(var i in options) {
		defaults[i] = options[i];
	}
}

Having this in jQuery core and adding some documention about this could by quite a help for plugin developers.

#71 fixed hide/show broken yehuda
Description

Test case:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="en">
  <head>
    <script src="jquery.js" type="text/javascript"></script>
	<script type="text/javascript">
      $.fn.toggleDown = function() {
        if(this.css('display') == "none") {
          this.show("fast")
        } else {
          this.hide("fast")
        }
      }
	</script>
  </head>

  <body>
    <a href="#" onclick="$('#hide').toggleDown()">Toggle</a>
	<div id="hide">Stuff</div>
  </body>
</html>

In earlier versions (130), the stuff inside the hidden div doesn't get restored in IE when show() is called. It does fill up the old amount of space, but the opacity doesn't return to normal.

In later versions (143), Internet Explorer returns "0.nodeType is null or not an object" when hide() or show() is called. It claims it's on line 65, but that seems unlikely.

#73 fixed Event Object [email protected]
Description

This problem is happening for me in Mac FireFox but not in Camino.

I'm basically doing $("#someid").css("width", '10px'); inside an event that's being bound onto another element. It's telling me that 'e' has not properties and a quick alert if typeof of 'e' shows that it's undefined. So I went and looked at JQuery.attr and fooled around in there with no success. I'm using the latest SVN version which I just checked out about 10 minutes ago.

Note: See TracQuery for help on using queries.