Fixes ctrl+s hotkeys in legacy editors

This commit is contained in:
perploug
2013-11-20 14:37:28 +01:00
parent 2cb4b207dc
commit d67db8a90a
2 changed files with 22 additions and 41 deletions

View File

@@ -87,18 +87,35 @@ Umbraco.Application.Actions = function () {
},
submitDefaultWindow: function () {
if (!this._isSaving) {
this._isSaving = true;
jQuery(".editorIcon[id*=save]:first, .editorIcon:input:image[id*=Save]:first").click();
//v6 way
var link = jQuery(".btn[id*=save]:first, .editorIcon[id*=save]:first, .editorIcon:input:image[id*=Save]:first");
//var link = $(".umb-panel-header .btn-primary");
//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:',''));
}else{
link.click();
}
}
this._isSaving = false;
return false;
},
bindSaveShortCut: function () {
jQuery(document).bind('keydown', 'ctrl+s', function (evt) { UmbClientMgr.appActions().submitDefaultWindow(); return false; });
jQuery(":input").bind('keydown', 'ctrl+s', function (evt) { UmbClientMgr.appActions().submitDefaultWindow(); return false; });
jQuery(document).bind('UMBRACO_TINYMCE_SAVE', function (evt, orgEvent) { UmbClientMgr.appActions().submitDefaultWindow(); return false; });
alert("mac");
var keys = "ctrl+s";
if (navigator.platform.toUpperCase().indexOf('MAC') >= 0) {
keys = "meta+s";
}
jQuery(document).bind('keydown', keys, function (evt) { UmbClientMgr.appActions().submitDefaultWindow(); return false; });
jQuery(":input").bind('keydown', keys, function (evt) { UmbClientMgr.appActions().submitDefaultWindow(); return false; });
},
shiftApp: function (whichApp, appName) {