Commit 6f5e2b9e authored by Romain Loth's avatar Romain Loth

annotation: clarify internal comments

parent ce9e9de3
...@@ -70,21 +70,15 @@ ...@@ -70,21 +70,15 @@
} }
return false; return false;
} }
// we only need one singleton at a time
// (<=> is only called once per doc, but value of annotation changes)
var selection = getSelected();
/* // £TODO extend "double click selection" on hyphen words
* When mouse selection was started, this used to grey out the text panel // and reduce it on apostrophe ones (except firefox)
*/ // cf. stackoverflow.com/a/39005881/2489184
// function toggleSelectionChangePanelClass(text) { // jsfiddle.net/avvhsruu/
// // if (text.trim() !== "" && !$element.hasClass('menu-is-opened')) {
// if (text.trim() !== "" && !$element.hasClass('menu-is-opened')) { // we only need one singleton at a time
// $(".text-panel").addClass("selection"); // (<=> is only created once per doc, but value of annotation changes)
// } else { var selectionObj = getSelected();
// $(".text-panel").removeClass("selection");
// }
// }
/* /*
* Dynamically construct the selection menu scope * Dynamically construct the selection menu scope
...@@ -261,7 +255,7 @@ ...@@ -261,7 +255,7 @@
// console.warn("FADE IN menu", $element) // console.warn("FADE IN menu", $element)
} }
else { else {
console.warn("=> else") // console.warn("=> else")
// close the menu // close the menu
$scope.menuItems = []; $scope.menuItems = [];
...@@ -293,7 +287,7 @@ ...@@ -293,7 +287,7 @@
}); });
/* /*
* Toggle the menu when clicking on an existing ngram keyword * Toggle the menu when clicking on an existing ngram or a free selection
*/ */
$(".text-container").mouseup(function(e){ $(".text-container").mouseup(function(e){
$(".text-container").unbind("mousemove", positionMenu); $(".text-container").unbind("mousemove", positionMenu);
...@@ -301,7 +295,7 @@ ...@@ -301,7 +295,7 @@
positionMenu(e); positionMenu(e);
// console.warn("calling toggleMenu from *mouseup*") // console.warn("calling toggleMenu from *mouseup*")
toggleMenu(null, selection.toString().trim()); toggleMenu(null, selectionObj.toString().trim());
}); });
$rootScope.$on("positionAnnotationMenu", positionElement); $rootScope.$on("positionAnnotationMenu", positionElement);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment