Index: trunk/extensions/JS2Support/mwEmbed/libraries/jquery/plugins/jquery.menu/jquery.menu.js |
— | — | @@ -5,11 +5,17 @@ |
6 | 6 | By: Maggie Costello Wachs (maggie@filamentgroup.com) and Scott Jehl (scott@filamentgroup.com) |
7 | 7 | http://www.filamentgroup.com |
8 | 8 | * reference articles: http://www.filamentgroup.com/lab/jquery_ipod_style_drilldown_menu/ |
| 9 | + |
| 10 | +* modified by Michael Dale, ( michael.dale@kaltura.com ) |
9 | 11 | |
10 | 12 | Copyright (c) 2009 Filament Group |
11 | 13 | Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses. |
12 | 14 | |
13 | | -NOTE: mvEmbed will switch to jquery ui menu once that is released |
| 15 | +NOTE: mwEmbed will switch to jquery ui menu once that is released |
| 16 | +NOTE: This menu contains several customizations for use in mwEmbed modules:: |
| 17 | + |
| 18 | +* added getLineItem helper function |
| 19 | +* added special class "divider" that is non selectable menu item horizontal hr |
14 | 20 | --------------------------------------------------------------------*/ |
15 | 21 | |
16 | 22 | |
— | — | @@ -120,6 +126,7 @@ |
121 | 127 | linkToFront: false |
122 | 128 | }, |
123 | 129 | showSpeed: 200, // show/hide speed in milliseconds |
| 130 | + createMenuCallback: null, |
124 | 131 | callerOnState: 'ui-state-active', // class to change the appearance of the link/button when the menu is showing |
125 | 132 | loadingState: 'ui-state-loading', // class added to the link/button while the menu is created |
126 | 133 | linkHover: 'ui-state-hover', // class for menu option hover state |
— | — | @@ -173,11 +180,11 @@ |
174 | 181 | this.showMenu = function() { |
175 | 182 | mw.log('$j.menu:: show menu' ); |
176 | 183 | killAllMenus(); |
177 | | - mw.log('done:: killAllMenus' ); |
| 184 | + mw.log('jquery.menu:: killAllMenus' ); |
178 | 185 | if ( ! menu.menuExists) { |
179 | 186 | menu.create() |
180 | 187 | }; |
181 | | - mw.log('done:: menu.create' ); |
| 188 | + mw.log('jquery.menu:: menu.create' ); |
182 | 189 | caller |
183 | 190 | .addClass('fg-menu-open') |
184 | 191 | .addClass(options.callerOnState); |
— | — | @@ -185,7 +192,7 @@ |
186 | 193 | menu.kill(); |
187 | 194 | return false; |
188 | 195 | }); |
189 | | - mw.log('done:: menu. binding container' ); |
| 196 | + mw.log('jquery.menu:: menu. binding container' ); |
190 | 197 | |
191 | 198 | container.hide().slideDown(options.showSpeed).find('.fg-menu:eq(0)'); |
192 | 199 | menu.menuOpen = true; |
— | — | @@ -271,7 +278,7 @@ |
272 | 279 | }; |
273 | 280 | break; |
274 | 281 | }; |
275 | | - }); |
| 282 | + }); |
276 | 283 | }; |
277 | 284 | |
278 | 285 | this.create = function() { |
— | — | @@ -314,11 +321,16 @@ |
315 | 322 | allLinks.hover( |
316 | 323 | function() { |
317 | 324 | var menuitem = $(this); |
318 | | - $('.'+options.linkHover).removeClass(options.linkHover).blur().parent().removeAttr('id'); |
319 | | - $(this).addClass(options.linkHover).focus().parent().attr('id','active-menuitem'); |
| 325 | + var menuli = menuitem.parent(); |
| 326 | + if( !menuli.hasClass('divider') && !menuli.hasClass('disabled') ){ |
| 327 | + $('.'+options.linkHover).removeClass(options.linkHover).blur().parent().removeAttr('id'); |
| 328 | + $(this).addClass(options.linkHover).focus().parent().addClass('active-menuitem'); |
| 329 | + } |
320 | 330 | }, |
321 | 331 | function() { |
322 | | - $(this).removeClass(options.linkHover).blur().parent().removeAttr('id'); |
| 332 | + if( !menuitem.hasClass('divider') && !menuitem.hasClass('disabled') ){ |
| 333 | + $(this).removeClass(options.linkHover).blur().parent().removeClass('active-menuitem'); |
| 334 | + } |
323 | 335 | } |
324 | 336 | ); |
325 | 337 | }; |
— | — | @@ -336,6 +348,10 @@ |
337 | 349 | |
338 | 350 | menu.setPosition(container, caller, options); |
339 | 351 | menu.menuExists = true; |
| 352 | + |
| 353 | + if( typeof options.createMenuCallback == 'function' ){ |
| 354 | + options.createMenuCallback(); |
| 355 | + } |
340 | 356 | }; |
341 | 357 | |
342 | 358 | this.chooseItem = function(item) { |
— | — | @@ -786,4 +802,3 @@ |
787 | 803 | }; |
788 | 804 | |
789 | 805 | } )( jQuery ); |
790 | | - |