mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Put the references autocomplete feature behind a feature flag for now.
This commit is contained in:
+2
@@ -45,6 +45,8 @@ define [
|
|||||||
references = @$scope.$root._references
|
references = @$scope.$root._references
|
||||||
ReferencesCompleter =
|
ReferencesCompleter =
|
||||||
getCompletions: (editor, session, pos, prefix, callback) ->
|
getCompletions: (editor, session, pos, prefix, callback) ->
|
||||||
|
if window._ENABLE_REFERENCES_AUTOCOMPLETE != true
|
||||||
|
return callback(null, [])
|
||||||
if references.keys
|
if references.keys
|
||||||
range = new Range(pos.row, 0, pos.row, pos.column)
|
range = new Range(pos.row, 0, pos.row, pos.column)
|
||||||
lineUpToCursor = editor.getSession().getTextRange(range)
|
lineUpToCursor = editor.getSession().getTextRange(range)
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ define [
|
|||||||
@getReferenceKeys()
|
@getReferenceKeys()
|
||||||
|
|
||||||
indexReferences: (doc_id) ->
|
indexReferences: (doc_id) ->
|
||||||
|
if window._ENABLE_REFERENCES_AUTOCOMPLETE != true
|
||||||
|
return
|
||||||
$.post(
|
$.post(
|
||||||
"/project/#{@$scope.project_id}/references",
|
"/project/#{@$scope.project_id}/references",
|
||||||
{
|
{
|
||||||
@@ -31,6 +33,8 @@ define [
|
|||||||
)
|
)
|
||||||
|
|
||||||
getReferenceKeys: () ->
|
getReferenceKeys: () ->
|
||||||
|
if window._ENABLE_REFERENCES_AUTOCOMPLETE != true
|
||||||
|
return
|
||||||
$.get(
|
$.get(
|
||||||
"/project/#{@$scope.project_id}/references/keys",
|
"/project/#{@$scope.project_id}/references/keys",
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user