double-click on action values to edit
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 29 Jun 2010 22:13:57 +0000 (00:13 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 29 Jun 2010 22:13:57 +0000 (00:13 +0200)
templates/actions/index.html.ep
templates/actions/view.html.ep

index 431e9b7..9a504b4 100644 (file)
@@ -68,5 +68,15 @@ console.debug(this,link_html);
                }).css({ 'background': '#ffe' });
        });
 
                }).css({ 'background': '#ffe' });
        });
 
+       $('label.checkbox_to_text span.value' ).live( 'dblclick', function() {
+               console.debug('checkbox to text',this);
+               var $checkbox = $(this).find('input[type=checkbox]');
+               $(this).html(
+                       '<input type=text name="'+$checkbox.attr('name')+'" value="'+$checkbox.attr('value')+'">'
+               );
+
+       });
+
+       console.debug('ready');
 });
 </script>
 });
 </script>
index 4111df2..d70d3cc 100644 (file)
 % while ( @$params ) {
 %      my $n = shift @$params;
 %      my $v = shift @$params;
 % while ( @$params ) {
 %      my $n = shift @$params;
 %      my $v = shift @$params;
-<li><label>
+<li><label class=checkbox_to_text>
 <%= $n %>
 <%= $n %>
+<span class=value title="double click to edit">
 <input type=checkbox name="<%= $n %>" value="<%= $v %>" checked>
 <%= $v %>
 <input type=checkbox name="<%= $n %>" value="<%= $v %>" checked>
 <%= $v %>
+</span>
 </label>
 % }
 </ul>
 </label>
 % }
 </ul>