Shift to input boxes because of the multiline issue;

This prevents duplication; and enter key behaves as expected;
This commit is contained in:
Abhishek Das
2013-04-06 02:00:30 +05:30
parent ae1421597f
commit 872341231c
5 changed files with 12 additions and 16 deletions
+1 -1
View File
@@ -36,7 +36,7 @@
<script type="text/template" id="taskTemplate">
<div class="task">
<div class="link"></div>
<textarea rows="1" data-id="<%= id %>" wrap="off" class="edit"><%= content %></textarea>
<input value="<%= content %>" data-id="<%= id %>" class="edit">
</div>
</script>
<script src="javascripts/vendor/jquery.min.js"></script>
+1 -1
View File
@@ -28,7 +28,7 @@ var app = app || {};
});
var a = taskView.render();
this.$el.append(a.el);
a.$input.focus();
//a.$input.focus();
console.log(a.$input.prop('selectionStart'));
}
+3 -3
View File
@@ -11,7 +11,7 @@ var app = app || {};
'click .task': 'edit',
'blur .edit': 'close',
'keyup .edit': 'broadcast',
'keypress .edit': 'add'
'keypress .edit': 'update'
},
initialize: function() {
@@ -46,11 +46,11 @@ var app = app || {};
});
},
add: function(e) {
update: function(e) {
if ( e.which === ENTER_KEY ) {
app.Tasks.add({content:''});
this.$input.blur();
//this.next('textarea').focus();
this.$el.next('li').find('input').focus();
}
},
+2 -4
View File
@@ -107,7 +107,7 @@ body {
z-index: 8;
background-color: #aaa;
}
textarea.edit {
input.edit {
box-shadow: none;
display: inline;
background: transparent;
@@ -117,7 +117,6 @@ body {
padding: 0;
margin: 0;
width: 620px;
height: 18px;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
@@ -131,9 +130,8 @@ body {
text-align: start;
-webkit-writing-mode: horizontal-tb;
}
textarea.edit:focus {
input.edit:focus {
background-color: white;
height: 18px;
}
}
}
+5 -7
View File
@@ -5610,7 +5610,7 @@ body #hackflowy #main .children li .task .link:hover {
background-color: #aaa;
}
/* line 110, ../sass/app.scss */
body #hackflowy #main .children li .task textarea.edit {
body #hackflowy #main .children li .task input.edit {
box-shadow: none;
display: inline;
background: transparent;
@@ -5620,7 +5620,6 @@ body #hackflowy #main .children li .task textarea.edit {
padding: 0;
margin: 0;
width: 620px;
height: 18px;
font-family: inherit;
font-size: inherit;
font-weight: inherit;
@@ -5634,16 +5633,15 @@ body #hackflowy #main .children li .task textarea.edit {
text-align: start;
-webkit-writing-mode: horizontal-tb;
}
/* line 134, ../sass/app.scss */
body #hackflowy #main .children li .task textarea.edit:focus {
/* line 133, ../sass/app.scss */
body #hackflowy #main .children li .task input.edit:focus {
background-color: white;
height: 18px;
}
/* line 142, ../sass/app.scss */
/* line 140, ../sass/app.scss */
body #hackflowy #main > .children {
margin-left: 0;
}
/* line 145, ../sass/app.scss */
/* line 143, ../sass/app.scss */
body #hackflowy #footer {
color: #333333;
margin: 10px 0;