Merge pull request #1677 from ether/ctrl-s-fade

show light yellow for .5 secs on save revision keypress
This commit is contained in:
John McLear 2013-03-28 20:11:30 -07:00
commit f1b60e9867
1 changed files with 5 additions and 0 deletions

View File

@ -3649,6 +3649,11 @@ function Ace2Inner(){
if ((!specialHandled) && isTypeForCmdKey && String.fromCharCode(which).toLowerCase() == "s" && (evt.metaKey || evt.ctrlKey)) /* Do a saved revision on ctrl S */
{
evt.preventDefault();
var originalBackground = parent.parent.$('#revisionlink').css("background")
parent.parent.$('#revisionlink').css({"background":"lightyellow"});
top.setTimeout(function(){
parent.parent.$('#revisionlink').css({"background":originalBackground});
}, 1000);
parent.parent.pad.collabClient.sendMessage({"type":"SAVE_REVISION"}); /* The parent.parent part of this is BAD and I feel bad.. It may break something */
specialHandled = true;
}