Opened 4 years ago

Closed 4 years ago

#18686 closed defect (wontfix)

All sample code snippets in API documentation "events" are the exact same

Reported by: Gavin R Owned by:
Priority: undecided Milestone: 1.13
Component: Documentation Version: 1.10.4
Keywords: Cc:
Blocked By: Blocking:

Description

All events on the api pages inside dijit - for example "dijit/form/Button" all have the example "example" code https://dojotoolkit.org/api/#1_10dijit_form_Button_onBlur

btn.subscribe("/my/topic"...

Attachments (1)

same-example.PNG (143.1 KB) - added by Gavin R 4 years ago.
all the example code is the same

Download all attachments as: .zip

Change History (4)

Changed 4 years ago by Gavin R

Attachment: same-example.PNG added

all the example code is the same

comment:1 Changed 4 years ago by Kitson Kelly

This is because _WidgetBase contains the following:

			// summary:
			//		Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
			//
			//		Connects specified obj/event to specified method of this object
			//		and registers for disconnect() on widget destroy.
			//
			//		Provide widget-specific analog to dojo.connect, except with the
			//		implicit use of this widget as the target object.
			//		Events connected with `this.connect` are disconnected upon
			//		destruction.
			// returns:
			//		A handle that can be passed to `disconnect` in order to disconnect before
			//		the widget is destroyed.
			// example:
			//	|	var btn = new Button();
			//	|	// when foo.bar() is called, call the listener we're going to
			//	|	// provide in the scope of btn
			//	|	btn.connect(foo, "bar", function(){
			//	|		console.debug(this.toString());
			//	|	});
			// tags:
			//		protected

comment:2 Changed 4 years ago by bill

That doesn't explain why onBlur() shows that code example for connect().

comment:3 Changed 4 years ago by dylan

Milestone: tbd1.12
Resolution: wontfix
Status: newclosed

Dojo 2 will use JSDoc, so this isn't going to get fixed, unless someone wants to work on patching this.

Note: See TracTickets for help on using tickets.