Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add F2 shortcut for renaming project #123

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/app/assets/less/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
@import "koalaui.css";
@import "_util.less";

//function class
//function class
.hide{display: none;}
.icon{
background: url(../img/icons.png) no-repeat;
Expand Down Expand Up @@ -44,7 +44,7 @@ body {
min-width: 350px;
padding-right: 5px;
}

//titlebar
#titlebar{
display: none;
Expand Down Expand Up @@ -197,6 +197,7 @@ body {
white-space: nowrap;
overflow: hidden;
font-size: 14px;
outline: none;
}

li:before{
Expand All @@ -219,7 +220,7 @@ body {
li.active{
background-color: #cedee9;
font-weight: bold;

&:after{
display: block;
width: 20px;
Expand Down Expand Up @@ -327,7 +328,7 @@ body {
}
#filelist{
padding: 0 10px;

.file_item{
padding:10px 0 10px 73px;
position: relative;
Expand Down Expand Up @@ -433,7 +434,7 @@ body {
min-width: 20px;
text-align: center;
border: 1px solid transparent;

&.current{
box-shadow:inset 1px 1px 1px #c0c0c0, inset -1px -1px 1px #c0c0c0;
border:1px solid #FFF;
Expand Down Expand Up @@ -511,7 +512,7 @@ body {
margin-top: 10px;
min-height: 290px;
max-height: 330px;
overflow-y: auto;
overflow-y: auto;
}
footer{
text-align: center;
Expand Down Expand Up @@ -560,7 +561,7 @@ body {
height: 100%;
background-color: #f5f5f5;
z-index: 1;

p {
width: 100%;
position: absolute;
Expand Down
11 changes: 11 additions & 0 deletions src/app/scripts/pages/main/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,4 +239,15 @@ $(document).on('blur', '#folders .changeName', function () {
});
$(document).on('keyup', '#folders .changeName', function (e) {
if (e.which === 13) $(this).trigger('blur');
});
// F2 shortcut
$(document).on('keydown', '#folders li', function (e) {
var target = $(this);
if (e.which === 113 && !target.children('input').length) {
var oldName = target.text(),
input = $('<input class="changeName"/>').val(oldName).focus();

target.html(input);
input.focus();
}
});
2 changes: 1 addition & 1 deletion src/app/views/template/main/folders.jade
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
each item in folders
li(data-src=item.src, data-id=item.id, id=item.id)= item.name
li(data-src=item.src, data-id=item.id, id=item.id, tabindex=0)= item.name