Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.js |
— | — | @@ -251,8 +251,14 @@ |
252 | 252 | |
253 | 253 | context.fn = { |
254 | 254 | 'trigger': function( name, event ) { |
255 | | - // Make a place for extra information to live |
256 | | - event.data = {}; |
| 255 | + // Event is an optional argument, but from here on out, at least the type field should be dependable |
| 256 | + if ( event == undefined ) { |
| 257 | + event = { 'type': 'custom' }; |
| 258 | + } |
| 259 | + // Ensure there's a place for extra information to live |
| 260 | + if ( event.data == undefined ) { |
| 261 | + event.data = {}; |
| 262 | + } |
257 | 263 | // Allow filtering to occur |
258 | 264 | if ( name in context.evt ) { |
259 | 265 | if ( !context.evt[name]( event ) ) { |