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