<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -147,7 +147,7 @@
 	&lt;%= subhead 'Console&lt;span&gt;&lt;a href=&quot;#&quot; id=&quot;console_clear&quot;&gt;clear&lt;/a&gt;&lt;/span&gt;', :border =&gt; false %&gt;
 	&lt;textarea id=&quot;text_console&quot; readonly=&quot;true&quot;&gt;&lt;/textarea&gt;
 	
-	&lt;% paragraph 'Adding Context: Conditional Menu Items &amp;amp; Labels' do %&gt;You can modify the contents of the &lt;b&gt;label&lt;/b&gt; by passing a function that returns a string into the label option instead of string. This function will be called each time the menu is opened. An optional &lt;b&gt;condition&lt;/b&gt; function option can be used as well. If this condition returns false, the menu item will not appear in the menu. If no items meet the condition checks, the menu will not open.&lt;% end %&gt;
+	&lt;% paragraph 'Adding Context: Conditional Menu Items &amp;amp; Labels' do %&gt;You can modify the contents of the &lt;b&gt;label&lt;/b&gt; by passing a function that returns a string into the label option instead of string. This function will be called each time the menu is opened. An optional &lt;b&gt;condition&lt;/b&gt; function option can be used as well. If this condition returns false, the menu item will not appear in the menu. If no items meet the condition checks, the menu will not open. You can also pass an &lt;b&gt;enabled&lt;/b&gt; parameter, that can be a boolean or a function that returns a boolean. If &lt;b&gt;enabled&lt;/b&gt; returns false, a class name of &quot;disabled&quot; will be added to the menu item.&lt;% end %&gt;
 	
 	&lt;% javascript 'JavaScript' do %&gt;&lt;%= context_menu_js %&gt;&lt;% end %&gt;
 	
@@ -174,7 +174,8 @@
 	&lt;% end %&gt;
 	&lt;% section 'item_hash' do %&gt;
 		&lt;% api_table 'Item Hash Structure','Type','Key','Description' do |api| %&gt;
-			&lt;% api.item :type =&gt; 'string', :key =&gt; 'label', :description =&gt; 'Text that will appear in the menu.' %&gt;
+			&lt;% api.item :type =&gt; 'bool', :key =&gt; 'enabled', :description =&gt; 'Wether the menu item is enabled. Defaults to true. Can be a function that returns bool.' %&gt;
+			&lt;% api.item :type =&gt; 'string', :key =&gt; 'label', :description =&gt; 'Text that will appear in the menu. Can be a function that returns a string.' %&gt;
 			&lt;% api.item :type =&gt; 'function', :key =&gt; 'callback', :description =&gt; 'Will be called when the menu item is selected.' %&gt;
 			&lt;% api.item :type =&gt; 'function', :key =&gt; 'condition', :description =&gt; 'Optional condition that will be called each time the menu is opened to see if the item will be included in the menu.' %&gt;
 		&lt;% end %&gt;</diff>
      <filename>app/views/page/control/_contextmenu.rhtml</filename>
    </modified>
    <modified>
      <diff>@@ -63,7 +63,11 @@ Control.ContextMenu = Class.create({
 			var item_container = $(document.createElement('li'));
 			item_container.update($value(item.label));
 			list.appendChild(item_container);
+			if(typeof(item.enabled) != &quot;undefined&quot;)
+				item_container[$value(item.enabled) ? 'removeClassName' : 'addClassName']('disabled');
 			item_container.observe('mousedown',function(event,item){
+				if(typeof(item.enabled) != &quot;undefined&quot; &amp;&amp; !$value(item.enabled))
+					return event.stop();
 				this.activated = $value(item.label);
 			}.bindAsEventListener(this,item));
 			item_container.observe('click',this.selectMenuItem.bindAsEventListener(this,item,item_container));</diff>
      <filename>public/javascripts/contextmenu.js</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0e827467c9b685b753965eaecae5ed3aca408ad8</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Johnson</name>
    <email>arjini@gmail.com</email>
  </author>
  <url>http://github.com/saucytiger/livepipe.net-documentation/commit/6f91757e657b31f6fc83260e626818b347448884</url>
  <id>6f91757e657b31f6fc83260e626818b347448884</id>
  <committed-date>2008-06-27T14:44:25-07:00</committed-date>
  <authored-date>2008-06-27T14:44:25-07:00</authored-date>
  <message>added enabled option to contextmenu</message>
  <tree>0e04f33a86d063ce75fac75af23d1e8ca91b2f2b</tree>
  <committer>
    <name>Ryan Johnson</name>
    <email>arjini@gmail.com</email>
  </committer>
</commit>
