commonified ripped paper effect and ctrl+s in todo

This commit is contained in:
Rushabh Mehta 2012-10-03 12:22:13 +05:30
parent c919d2579e
commit ac7baf046a
3 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,5 @@
h1, h2, h3, h4, h5 {
font-family: Arial, Helvetica, sans-serif;
margin-top: 0.2em;
}
body {

View File

@ -182,6 +182,8 @@ erpnext.setup_mousetrap = function() {
Mousetrap.bind(["command+s", "ctrl+s"], function() {
if(cur_frm)
cur_frm.save();
else if(wn.container.page.save_action)
wn.container.page.save_action();
return false;
});
}

View File

@ -56,7 +56,7 @@ erpnext.todo.ToDoItem = Class.extend({
todo.fullname = '';
if(todo.assigned_by) {
var assigned_by = wn.boot.user_info[todo.assigned_by]
todo.fullname = repl("[By %(fullname)s]  ", {
todo.fullname = repl("[By %(fullname)s] ".bold(), {
fullname: (assigned_by ? assigned_by.fullname : todo.assigned_by),
});
}
@ -64,7 +64,7 @@ erpnext.todo.ToDoItem = Class.extend({
var parent_list = "#todo-list";
if(todo.owner !== user) {
var owner = wn.boot.user_info[todo.owner];
todo.fullname = repl("[To %(fullname)s]  ", {
todo.fullname = repl("[To %(fullname)s] ".bold(), {
fullname: (owner ? owner.fullname : todo.owner),
});
}
@ -136,7 +136,7 @@ erpnext.todo.make_dialog = function(det) {
{fieldtype:'Date', fieldname:'date', label:'Event Date', reqd:1},
{fieldtype:'Check', fieldname:'checked', label:'Completed'},
{fieldtype:'Select', fieldname:'priority', label:'Priority', reqd:1, 'options':['Medium','High','Low'].join('\n')},
{fieldtype:'Button', fieldname:'save', label:'Save'}
{fieldtype:'Button', fieldname:'save', label:'Save (Ctrl+S)'}
]
});
@ -187,7 +187,15 @@ wn.pages.todo.onload = function(wrapper) {
erpnext.todo.make_dialog({
date:get_today(), priority:'Medium', checked:0, description:''});
}, 'icon-plus');
wrapper.appframe.add_ripped_paper_effect(wrapper);
// load todos
erpnext.todo.refresh();
// save on click
wrapper.save_action = function() {
if(erpnext.todo.dialog && erpnext.todo.dialog.display) {
erpnext.todo.dialog.fields_dict.save.input.click();
}
};
}