fixes dublicate hotkey in legacy editors
This commit is contained in:
@@ -31,8 +31,7 @@
|
||||
|
||||
$.ctrl("S", function(){
|
||||
var link = $(".umb-panel-header .btn-primary");
|
||||
var b = link.click();
|
||||
|
||||
|
||||
//this is made of bad, to work around webforms horrible wiring
|
||||
if(!link.hasClass("client-side") && link.attr("href").indexOf("javascript:") == 0){
|
||||
eval(link.attr('href').replace('javascript:',''));
|
||||
@@ -59,23 +58,26 @@
|
||||
$.ctrl = function(key, callback, args) {
|
||||
var isMac = navigator.platform.toUpperCase().indexOf('MAC')>=0;
|
||||
var isCtrl = false;
|
||||
|
||||
$(document).keydown(function(e) {
|
||||
if(!args) args=[]; // IE barks when args is null
|
||||
var modKey = isMac ? e.metaKey : e.ctrlKey;
|
||||
if(modKey){
|
||||
isCtrl = true;
|
||||
}
|
||||
//if(modKey){
|
||||
// isCtrl = true;
|
||||
//}
|
||||
|
||||
if(isCtrl && e.keyCode == key.charCodeAt(0)) {
|
||||
if(modKey && e.keyCode == key.charCodeAt(0)) {
|
||||
callback.apply(this, args);
|
||||
return false;
|
||||
}
|
||||
|
||||
}).keyup(function(e) {
|
||||
});
|
||||
|
||||
/*.keyup(function(e) {
|
||||
var modKey = isMac ? e.metaKey : e.ctrlKey;
|
||||
if(modKey){
|
||||
isCtrl = false;
|
||||
}
|
||||
});
|
||||
}); */
|
||||
};
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user