mirror of
https://github.com/wassname/HackFlowy.git
synced 2026-07-07 00:06:38 +08:00
Shift to input boxes because of the multiline issue;
This prevents duplication; and enter key behaves as expected;
This commit is contained in:
+1
-1
@@ -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>
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user