Commit b88c5bd5 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

when copying from list only element types that are available in left panel

parent 7c304ad5
......@@ -163,16 +163,13 @@ ChooseAnnotatorsDialog.prototype.setElementType = function (elementType) {
var copyFromSelect = Functions.createElement({type: "select", style: "margin:5px"});
element.appendChild(copyFromSelect);
var options = [], i;
for (i = 0; i < configuration.getElementTypes().length; i++) {
var type = configuration.getElementTypes()[i];
var name = type.className;
if (name.indexOf(".") > 0) {
name = name.substr(name.lastIndexOf(".") + 1);
}
var nodeList = self.getTypeNodeList();
for (i = 0; i < nodeList.length; i++) {
var type = nodeList[i];
options.push(Functions.createElement({
type: "option",
value: type.className,
content: name
value: type.data.className,
content: type.text
}));
}
options.sort(function (a, b) {
......@@ -567,8 +564,8 @@ ChooseAnnotatorsDialog.prototype.getParameterName = function (parameter) {
ChooseAnnotatorsDialog.prototype.copyAnnotatorsToChildren = function (from, to, user) {
if (user.getPreferences()._elementAnnotators[from.className] === undefined) {
logger.warn("Cannot copy annotator from " + from.className + " to " + to.className + ". Annotators don't exist");
user.getPreferences()._elementAnnotators[from.className] = user.getPreferences()._elementAnnotators[to.className];
user.getPreferences()._elementAnnotators[from.className] = user.getPreferences().getElementAnnotators(to.className);
}
user.getPreferences()._elementAnnotators[to.className] = user.getPreferences()._elementAnnotators[from.className];
user.getPreferences()._elementAnnotators[to.className] = user.getPreferences().getElementAnnotators(from.className);
};
module.exports = ChooseAnnotatorsDialog;
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