input/form switching cleanup

This commit is contained in:
Jörn Friedrich Dreyer 2013-01-02 17:02:55 +01:00
parent 4a7604daa2
commit 03b8a065cf
2 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@
#new>ul>li { height:20px; margin:.3em; padding-left:2em; padding-bottom:0.1em; #new>ul>li { height:20px; margin:.3em; padding-left:2em; padding-bottom:0.1em;
background-repeat:no-repeat; cursor:pointer; } background-repeat:no-repeat; cursor:pointer; }
#new>ul>li>p { cursor:pointer; } #new>ul>li>p { cursor:pointer; }
#new>ul>li>input { padding:0.3em; margin:-0.3em; } #new>ul>li>form>input { padding:0.3em; margin:-0.3em; }
#upload { #upload {
height:27px; padding:0; margin-left:0.2em; overflow:hidden; height:27px; padding:0; margin-left:0.2em; overflow:hidden;

View File

@ -477,7 +477,7 @@ $(document).ready(function() {
$('#new').removeClass('active'); $('#new').removeClass('active');
$('#new li').each(function(i,element){ $('#new li').each(function(i,element){
if($(element).children('p').length==0){ if($(element).children('p').length==0){
$(element).children('input').remove(); $(element).children('form').remove();
$(element).append('<p>'+$(element).data('text')+'</p>'); $(element).append('<p>'+$(element).data('text')+'</p>');
} }
}); });
@ -505,8 +505,8 @@ $(document).ready(function() {
var text=$(this).children('p').text(); var text=$(this).children('p').text();
$(this).data('text',text); $(this).data('text',text);
$(this).children('p').remove(); $(this).children('p').remove();
var input=$('<input>');
var form=$('<form></form>'); var form=$('<form></form>');
var input=$('<input>');
form.append(input); form.append(input);
$(this).append(form); $(this).append(form);
input.focus(); input.focus();