diff --git a/rd_ui/app/index.html b/rd_ui/app/index.html index 71b1db3a..22b3c2de 100644 --- a/rd_ui/app/index.html +++ b/rd_ui/app/index.html @@ -101,6 +101,8 @@ + + diff --git a/rd_ui/app/scripts/controllers.js b/rd_ui/app/scripts/controllers.js index 2f64e499..2014f367 100644 --- a/rd_ui/app/scripts/controllers.js +++ b/rd_ui/app/scripts/controllers.js @@ -39,6 +39,11 @@ } } + Mousetrap.bindGlobal("meta+s", function(e) { + e.preventDefault(); + $scope.saveQuery(); + }); + $scope.$on('$locationChangeStart', function(event, next, current) { if (next.split("#")[0] == current.split("#")[0]) { return; @@ -48,6 +53,8 @@ !confirm(leavingPageText + "\n\nAre you sure you want to leave this page?")) { event.preventDefault(); } + + Mousetrap.unbind("meta+s"); }); $scope.$parent.pageTitle = "Query Fiddle"; diff --git a/rd_ui/bower.json b/rd_ui/bower.json index 9792acc1..efb967be 100644 --- a/rd_ui/bower.json +++ b/rd_ui/bower.json @@ -17,7 +17,8 @@ "angular-growl": "0.3.1", "pivottable": "git@github.com:arikfr/pivottable.git#master", "cornelius": "git@github.com:restorando/cornelius.git", - "gridster": "0.2.0" + "gridster": "0.2.0", + "mousetrap": "~1.4.6" }, "devDependencies": { "angular-mocks": "~1.0.7",