1 /** 2 * @fileOverview represent a menu option , just make it selectable and can have select status 3 * @author yiminghe@gmail.com 4 */ 5 KISSY.add("menubutton/option", function (S, Menu) { 6 var MenuItem = Menu.Item; 7 /** 8 * @name Option 9 * @class 10 * Option for Select component. 11 * xclass: 'option'. 12 * @memberOf MenuButton 13 * @extends Menu.Item 14 */ 15 var Option = MenuItem.extend( 16 /** 17 * @lends MenuButton.Option.prototype 18 */ 19 { 20 /** 21 * Handle blur event. 22 */ 23 handleBlur:function () { 24 return Option.superclass.handleBlur.apply(this, arguments); 25 } 26 }, { 27 ATTRS:/** 28 * @lends MenuButton.Option.prototype 29 */ 30 { 31 /** 32 * Whether this option can be selected. 33 * Default : true. 34 * @type Boolean 35 */ 36 selectable:{ 37 value:true 38 }, 39 40 /** 41 * String will be used as select 's content if selected. 42 * @type String 43 */ 44 textContent:{ 45 46 } 47 } 48 }, { 49 xclass:'option', 50 priority:10 51 }); 52 53 return Option; 54 }, { 55 requires:['menu'] 56 });