Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
66cf7ee9
Commit
66cf7ee9
authored
Aug 20, 2015
by
Elias
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotations Fix : selection menu position and toggling
parent
750e7a46
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
highlight.js
annotations/static/annotations/highlight.js
+9
-6
No files found.
annotations/static/annotations/highlight.js
View file @
66cf7ee9
...
...
@@ -58,7 +58,7 @@
* When mouse selection is started, we highlight it
*/
function
toggleSelectionHighlight
(
text
)
{
if
(
text
.
trim
()
!==
""
)
{
if
(
text
.
trim
()
!==
""
&&
!
$element
.
hasClass
(
'menu-is-opened'
)
)
{
$
(
".text-panel"
).
addClass
(
"selection"
);
}
else
{
$
(
".text-panel"
).
removeClass
(
"selection"
);
...
...
@@ -76,7 +76,7 @@
// variable used in onClick
$scope
.
selection_text
=
angular
.
copy
(
annotation
);
if
(
angular
.
isObject
(
annotation
))
{
if
(
angular
.
isObject
(
annotation
)
&&
!
$element
.
hasClass
(
'menu-is-opened'
)
)
{
// existing ngram
// Delete from the current list
$scope
.
menuItems
=
[
...
...
@@ -92,7 +92,7 @@
$scope
.
menuItems
.
push
({
'action'
:
'post'
,
'listId'
:
stoplist_id
,
'verb'
:
'
Add
to'
,
'verb'
:
'
Move
to'
,
'listName'
:
$rootScope
.
lists
[
stoplist_id
]
});
}
else
if
(
$rootScope
.
lists
[
annotation
.
list_id
]
==
"StopList"
)
{
...
...
@@ -100,13 +100,14 @@
$scope
.
menuItems
.
push
({
'action'
:
'post'
,
'listId'
:
miamlist_id
,
'verb'
:
'
Add
to'
,
'verb'
:
'
Move
to'
,
'listName'
:
$rootScope
.
lists
[
miamlist_id
]
});
}
// show the menu
$element
.
fadeIn
(
100
);
}
else
if
(
annotation
.
trim
()
!==
""
)
{
$element
.
addClass
(
'menu-is-opened'
);
}
else
if
(
annotation
.
trim
()
!==
""
&&
!
$element
.
hasClass
(
'menu-is-opened'
))
{
// new ngram
$scope
.
menuItems
=
[
{
...
...
@@ -118,10 +119,12 @@
];
// show the menu
$element
.
fadeIn
(
100
);
$element
.
addClass
(
'menu-is-opened'
);
}
else
{
$scope
.
menuItems
=
[];
// close the menu
$element
.
fadeOut
(
100
);
$element
.
removeClass
(
'menu-is-opened'
);
}
});
});
...
...
@@ -159,7 +162,7 @@
* Toggle the menu when clicking on an existing ngram keyword
*/
$
(
".text-container"
).
delegate
(
':not("#selection")'
,
"click"
,
function
(
e
)
{
if
(
$
(
e
.
target
).
hasClass
(
"keyword-inline"
))
return
;
//
if ($(e.target).hasClass("keyword-inline")) return;
positionMenu
(
e
);
toggleSelectionHighlight
(
selection
.
toString
().
trim
());
toggleMenu
(
null
,
selection
.
toString
().
trim
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment