Opened 12 years ago

Closed 12 years ago

#3615 closed defect (fixed)

change _wireUpMethod to support dojo/connect or dojo/method instead of a separate attribute "mode"

Reported by: guest Owned by: alex
Priority: high Milestone: 0.9
Component: General Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

from cameron@… on IRC :

<Fracture> slightlyoff: in dojo.parser._wireUpMethod, it uses the attribute 'mode' of the script tag to determine if it should connect or override the method.  Would it make sence to instead have <script type='dojo/connect'> always connect, and have <script type='dojo/method'> always replace ?
<slightlyoff> Fracture: I don't want 2 queries against the DOM
<slightlyoff> sorry
 = 
 but it had occured to me
 hrm...
 I could do
 type~='dojo/'
<Fracture> it wouldn't need them.. can't it just handle dojo/* ? then test for the type in the function
 yep
<slightlyoff> yeah...we already have attribute partials matching...
 hrm
 file a bug?
 I think it makes a lot of sense
 I'll take that bug

this impacts on dojo.parser.instantiate where it extracts the preambles :

I suggest that preambles is made to work with dojo/connect or dojo/method even though it never uses dojo.connect - just to be consistent - however, its your call.

var preambles = dojo.query("> script[type='dojo/method'][event='preamble']", node).orphan();

and dojo.parser.instantiate where it extracts the other scripts :

var scripts = dojo.query("> script[type='dojo/method']", node).orphan();

and also in dijit.Declaration :

var scripts = dojo.query("> script[type='dojo/connect']", src).orphan();

Change History (3)

comment:1 Changed 12 years ago by bill

Milestone: 0.9
Owner: changed from anonymous to alex
Priority: normalhigh

(marking for 0.9 since it's an API change)

comment:2 Changed 12 years ago by alex

Status: newassigned

comment:3 Changed 12 years ago by alex

Resolution: fixed
Status: assignedclosed

(In [10018]) migrate the rather tedious <script type="dojo/method" mode="connect" event="...."> syntax to simply <script type="dojo/connect" event="...">. Fixes #3615

Note: See TracTickets for help on using tickets.