Parcourir la source

Added tooltip with keyboard shortcut in the recompile button.

Paulo Reis il y a 10 ans
Parent
commit
a9e0185098

+ 6 - 1
services/web/app/views/project/editor/pdf.jade

@@ -1,6 +1,11 @@
 div.full-size.pdf(ng-controller="PdfController")
 	.toolbar.toolbar-tall
-		.btn-group(dropdown)
+		.btn-group(
+			dropdown,
+			tooltip="{{modifierKey}} + Enter",
+			tooltip-popup-delay="500"
+			tooltip-append-to-body="true"
+		)
 			a.btn.btn-info(
 				href,
 				ng-disabled="pdf.compiling",

+ 6 - 0
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -1,5 +1,6 @@
 define [
 	"base"
+	"ace/ace"
 	"libs/latex-log-parser"
 	"libs/bib-log-parser"
 ], (App, LogParser, BibLogParser) ->
@@ -13,6 +14,11 @@ define [
 		$scope.pdf.view = if $scope?.pdf?.url then 'pdf' else 'uncompiled'
 		$scope.shouldShowLogs = false
 
+		if ace.require("ace/lib/useragent").isMac
+			$scope.modifierKey = "Cmd"
+		else
+			$scope.modifierKey = "Ctrl"
+
 		$scope.$on "project:joined", () ->
 			return if !autoCompile
 			autoCompile = false