-/*\r
- * Ext JS Library 2.2.1\r
- * Copyright(c) 2006-2009, Ext JS, LLC.\r
- * licensing@extjs.com\r
+/*!
+ * Ext JS Library 3.0.0
+ * Copyright(c) 2006-2009 Ext JS, LLC
+ * licensing@extjs.com
+ * http://www.extjs.com/license
+ */
+/**\r
+ * @class Ext.ux.TabCloseMenu\r
+ * @extends Object \r
+ * Plugin (ptype = 'tabclosemenu') for adding a close context menu to tabs.\r
* \r
- * http://extjs.com/license\r
+ * @ptype tabclosemenu\r
*/\r
-\r
-\r
-// Very simple plugin for adding a close context menu to tabs\r
-\r
Ext.ux.TabCloseMenu = function(){\r
var tabs, menu, ctxItem;\r
this.init = function(tp){\r
tabs = tp;\r
tabs.on('contextmenu', onContextMenu);\r
- }\r
+ };\r
\r
function onContextMenu(ts, item, e){\r
if(!menu){ // create context menu on first right click\r
- menu = new Ext.menu.Menu([{\r
+ menu = new Ext.menu.Menu({ \r
+ items: [{\r
id: tabs.id + '-close',\r
text: 'Close Tab',\r
handler : function(){\r
}\r
});\r
}\r
- }]);\r
+ }]});\r
}\r
ctxItem = item;\r
var items = menu.items;\r
}\r
});\r
items.get(tabs.id + '-close-others').setDisabled(disableOthers);\r
+ e.stopEvent();\r
menu.showAt(e.getPoint());\r
}\r
-};
\ No newline at end of file
+};\r
+\r
+Ext.preg('tabclosemenu', Ext.ux.TabCloseMenu);\r