Index: trunk/extensions/UsabilityInitiative/js/jquery.wikiEditor.js |
— | — | @@ -90,18 +90,19 @@ |
91 | 91 | addSection: function( $section, section, sectionId ) { |
92 | 92 | /** |
93 | 93 | * Wraps performAction with tool specific UI interaction |
94 | | - * @param {Object} tool |
95 | | - * @param {Object} element |
96 | 94 | */ |
97 | 95 | var useTool = function() { |
98 | 96 | var tool = $(this).data( 'tool' ); |
99 | | - if ( 'type' in tool && 'action' in tool ) { |
| 97 | + if ( 'type' in tool ) { |
| 98 | + console.log( tool.type ); |
100 | 99 | switch ( tool.type ) { |
101 | 100 | case 'button': |
102 | 101 | case 'link': |
103 | | - context.modules.toolbar.performAction( |
104 | | - tool.action |
105 | | - ); |
| 102 | + if ( 'action' in tool ) { |
| 103 | + context.modules.toolbar.performAction( |
| 104 | + tool.action |
| 105 | + ); |
| 106 | + } |
106 | 107 | break; |
107 | 108 | case 'select': |
108 | 109 | if ( 'list' in tool && $(this).val() in tool.list ) { |