mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Add toolbar with button to toggle rich text
This commit is contained in:
parent
7783e18a50
commit
b9327cb2d4
3 changed files with 24 additions and 1 deletions
|
@ -30,9 +30,12 @@ div.full-size(
|
||||||
i.fa.fa-arrow-left
|
i.fa.fa-arrow-left
|
||||||
| #{translate("open_a_file_on_the_left")}
|
| #{translate("open_a_file_on_the_left")}
|
||||||
|
|
||||||
|
.toolbar.toolbar-editor(ng-controller="EditorToolbarController")
|
||||||
|
button(ng-click="toggleRichText()") Rich Text
|
||||||
|
|
||||||
#editor(
|
#editor(
|
||||||
ace-editor="editor",
|
ace-editor="editor",
|
||||||
ng-show="!!editor.sharejs_doc && !editor.opening"
|
ng-if="!!editor.sharejs_doc && !editor.opening && !editor.richText"
|
||||||
theme="settings.theme",
|
theme="settings.theme",
|
||||||
keybindings="settings.mode",
|
keybindings="settings.mode",
|
||||||
font-size="settings.fontSize",
|
font-size="settings.fontSize",
|
||||||
|
@ -63,6 +66,12 @@ div.full-size(
|
||||||
renderer-data="reviewPanel.rendererData"
|
renderer-data="reviewPanel.rendererData"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#editor-rich-text(
|
||||||
|
cm-editor
|
||||||
|
ng-if="!editor.opening && editor.richText"
|
||||||
|
sharejs-doc="editor.sharejs_doc"
|
||||||
|
)
|
||||||
|
|
||||||
include ./review-panel
|
include ./review-panel
|
||||||
|
|
||||||
.ui-layout-east
|
.ui-layout-east
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
define [
|
define [
|
||||||
"ide/editor/Document"
|
"ide/editor/Document"
|
||||||
"ide/editor/directives/aceEditor"
|
"ide/editor/directives/aceEditor"
|
||||||
|
"ide/editor/directives/cmEditor"
|
||||||
"ide/editor/controllers/SavingNotificationController"
|
"ide/editor/controllers/SavingNotificationController"
|
||||||
|
"ide/editor/controllers/EditorToolbarController"
|
||||||
], (Document) ->
|
], (Document) ->
|
||||||
class EditorManager
|
class EditorManager
|
||||||
constructor: (@ide, @$scope) ->
|
constructor: (@ide, @$scope) ->
|
||||||
|
@ -12,6 +14,7 @@ define [
|
||||||
opening: true
|
opening: true
|
||||||
trackChanges: false
|
trackChanges: false
|
||||||
wantTrackChanges: false
|
wantTrackChanges: false
|
||||||
|
richText: false
|
||||||
}
|
}
|
||||||
|
|
||||||
@$scope.$on "entity:selected", (event, entity) =>
|
@$scope.$on "entity:selected", (event, entity) =>
|
||||||
|
@ -186,3 +189,7 @@ define [
|
||||||
@$scope.editor.trackChanges = want
|
@$scope.editor.trackChanges = want
|
||||||
else
|
else
|
||||||
@_syncTimeout = setTimeout tryToggle, 100
|
@_syncTimeout = setTimeout tryToggle, 100
|
||||||
|
|
||||||
|
toggleRichText: () ->
|
||||||
|
@$scope.editor.richText = !@$scope.editor.richText
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
define [
|
||||||
|
"base"
|
||||||
|
"ide/editor/Document"
|
||||||
|
], (App, Document) ->
|
||||||
|
App.controller "EditorToolbarController", ($scope, ide) ->
|
||||||
|
$scope.toggleRichText = () ->
|
||||||
|
ide.editorManager.toggleRichText()
|
Loading…
Reference in a new issue