[keyboard shortcuts] keyboard shortcuts using jquery hotkeys instead of mousetrap
diff --git a/public/js/startup.js b/public/js/startup.js
index 5e651c5..f587fbc 100644
--- a/public/js/startup.js
+++ b/public/js/startup.js
@@ -135,21 +135,19 @@
}
erpnext.setup_mousetrap = function() {
- Mousetrap.bind(["command+g", "ctrl+g"], function() {
+ $(document).keydown("meta+g ctrl+g", function(e) {
wn.ui.toolbar.search.show();
return false;
});
-
- Mousetrap.bind(["command+s", "ctrl+s"], function() {
- if(cur_frm && !cur_frm.save_disabled && cint(cur_frm.doc.docstatus)===0)
- cur_frm.save();
- else if(cur_frm && !cur_frm.save_disabled && cint(cur_frm.doc.docstatus)===1
- && cur_frm.doc.__unsaved)
- cur_frm.frm_head.appframe.buttons['Update'].click();
+
+ $(document).keydown("meta+s ctrl+s", function(e) {
+ if(cur_frm) {
+ cur_frm.save_or_update();
+ }
else if(wn.container.page.save_action)
wn.container.page.save_action();
return false;
- });
+ })
}
// start
diff --git a/startup/boot.py b/startup/boot.py
index b202d17..7d5eb4e 100644
--- a/startup/boot.py
+++ b/startup/boot.py
@@ -14,13 +14,7 @@
bootinfo['custom_css'] = webnotes.conn.get_value('Style Settings', None, 'custom_css') or ''
bootinfo['website_settings'] = webnotes.model.doc.getsingle('Website Settings')
- if webnotes.session['user']=='Guest':
- bootinfo['website_menus'] = webnotes.conn.sql("""select label, url, custom_page,
- parent_label, parentfield
- from `tabTop Bar Item` where parent='Website Settings' order by idx asc""", as_dict=1)
- bootinfo['startup_code'] = \
- webnotes.conn.get_value('Website Settings', None, 'startup_code')
- else:
+ if webnotes.session['user']!='Guest':
bootinfo['letter_heads'] = get_letter_heads()
import webnotes.model.doctype