Gitlab CSE Unil

Commit 6eb9a543 authored by M. Chardon's avatar M. Chardon
Browse files

correction bug resize sur plusieurs pages

parent 51391af1
......@@ -1666,7 +1666,8 @@ Y.extend(ANNOTATION, Y.Base, {
}
div += "style='min-height:7px;min-width:" + interx + "px;' ";
}
div += "data-direction='" + direction + "' "
div += "data-direction='" + direction + "' ";
div += "data-page='" + this.pageno + "' "
+ "> "
+ "</div>";
return Y.Node.create(div);
......@@ -5349,7 +5350,8 @@ EDITOR.prototype = {
break;
case 'resize':
drawingcanvas.setStyle('cursor', 'default');
resizezones.addClass('assignfeedback_editpdfplus_resize_active');
var resizezonespage = Y.all('.assignfeedback_editpdfplus_resize[data-page=' + this.currentpage + ']');
resizezonespage.addClass('assignfeedback_editpdfplus_resize_active');
break;
default:
drawingcanvas.setStyle('cursor', 'crosshair');
......@@ -6476,22 +6478,6 @@ EDITOR.prototype = {
*/
create_annotation: function (type, toolid, data, toolobjet) {
/*pour fonctionnement des anciens outils*/
/*if (type && typeof type !== 'undefined' && (typeof toolid === 'undefined' || toolid === null)) {
window.console.log("create_annotation deprecated");
if (type === "line") {
data.toolid = TOOLTYPE.LINE;
} else if (type === "rectangle") {
data.toolid = TOOLTYPE.RECTANGLE;
} else if (type === "oval") {
data.toolid = TOOLTYPE.OVAL;
} else if (type === "pen") {
data.toolid = TOOLTYPE.PEN;
} else if (type === "highlight") {
data.toolid = TOOLTYPE.HIGHLIGHT;
}
data.tooltype = this.tools[data.toolid];
} else */
if (toolid !== null && toolid[0] === 'c') {
data.toolid = toolid.substr(8);
}
......@@ -6738,6 +6724,17 @@ EDITOR.prototype = {
}
}
//remove active class for resize areas
var resizezones = Y.all('.assignfeedback_editpdfplus_resize');
if (resizezones) {
resizezones.removeClass('assignfeedback_editpdfplus_resize_active');
}
//refresh selected tool
if (!this.get('readonly')) {
this.refresh_button_state();
}
for (i = 0; i < page.annotations.length; i++) {
annot = page.annotations[i];
var tool = annot.tooltype;
......
......@@ -1666,7 +1666,8 @@ Y.extend(ANNOTATION, Y.Base, {
}
div += "style='min-height:7px;min-width:" + interx + "px;' ";
}
div += "data-direction='" + direction + "' "
div += "data-direction='" + direction + "' ";
div += "data-page='" + this.pageno + "' "
+ "> "
+ "</div>";
return Y.Node.create(div);
......@@ -5349,7 +5350,8 @@ EDITOR.prototype = {
break;
case 'resize':
drawingcanvas.setStyle('cursor', 'default');
resizezones.addClass('assignfeedback_editpdfplus_resize_active');
var resizezonespage = Y.all('.assignfeedback_editpdfplus_resize[data-page=' + this.currentpage + ']');
resizezonespage.addClass('assignfeedback_editpdfplus_resize_active');
break;
default:
drawingcanvas.setStyle('cursor', 'crosshair');
......@@ -6476,22 +6478,6 @@ EDITOR.prototype = {
*/
create_annotation: function (type, toolid, data, toolobjet) {
/*pour fonctionnement des anciens outils*/
/*if (type && typeof type !== 'undefined' && (typeof toolid === 'undefined' || toolid === null)) {
window.console.log("create_annotation deprecated");
if (type === "line") {
data.toolid = TOOLTYPE.LINE;
} else if (type === "rectangle") {
data.toolid = TOOLTYPE.RECTANGLE;
} else if (type === "oval") {
data.toolid = TOOLTYPE.OVAL;
} else if (type === "pen") {
data.toolid = TOOLTYPE.PEN;
} else if (type === "highlight") {
data.toolid = TOOLTYPE.HIGHLIGHT;
}
data.tooltype = this.tools[data.toolid];
} else */
if (toolid !== null && toolid[0] === 'c') {
data.toolid = toolid.substr(8);
}
......@@ -6738,6 +6724,17 @@ EDITOR.prototype = {
}
}
//remove active class for resize areas
var resizezones = Y.all('.assignfeedback_editpdfplus_resize');
if (resizezones) {
resizezones.removeClass('assignfeedback_editpdfplus_resize_active');
}
//refresh selected tool
if (!this.get('readonly')) {
this.refresh_button_state();
}
for (i = 0; i < page.annotations.length; i++) {
annot = page.annotations[i];
var tool = annot.tooltype;
......
......@@ -1134,7 +1134,8 @@ Y.extend(ANNOTATION, Y.Base, {
}
div += "style='min-height:7px;min-width:" + interx + "px;' ";
}
div += "data-direction='" + direction + "' "
div += "data-direction='" + direction + "' ";
div += "data-page='" + this.pageno + "' "
+ "> "
+ "</div>";
return Y.Node.create(div);
......
......@@ -283,7 +283,8 @@ EDITOR.prototype = {
break;
case 'resize':
drawingcanvas.setStyle('cursor', 'default');
resizezones.addClass('assignfeedback_editpdfplus_resize_active');
var resizezonespage = Y.all('.assignfeedback_editpdfplus_resize[data-page=' + this.currentpage + ']');
resizezonespage.addClass('assignfeedback_editpdfplus_resize_active');
break;
default:
drawingcanvas.setStyle('cursor', 'crosshair');
......@@ -1410,22 +1411,6 @@ EDITOR.prototype = {
*/
create_annotation: function (type, toolid, data, toolobjet) {
/*pour fonctionnement des anciens outils*/
/*if (type && typeof type !== 'undefined' && (typeof toolid === 'undefined' || toolid === null)) {
window.console.log("create_annotation deprecated");
if (type === "line") {
data.toolid = TOOLTYPE.LINE;
} else if (type === "rectangle") {
data.toolid = TOOLTYPE.RECTANGLE;
} else if (type === "oval") {
data.toolid = TOOLTYPE.OVAL;
} else if (type === "pen") {
data.toolid = TOOLTYPE.PEN;
} else if (type === "highlight") {
data.toolid = TOOLTYPE.HIGHLIGHT;
}
data.tooltype = this.tools[data.toolid];
} else */
if (toolid !== null && toolid[0] === 'c') {
data.toolid = toolid.substr(8);
}
......@@ -1672,6 +1657,17 @@ EDITOR.prototype = {
}
}
//remove active class for resize areas
var resizezones = Y.all('.assignfeedback_editpdfplus_resize');
if (resizezones) {
resizezones.removeClass('assignfeedback_editpdfplus_resize_active');
}
//refresh selected tool
if (!this.get('readonly')) {
this.refresh_button_state();
}
for (i = 0; i < page.annotations.length; i++) {
annot = page.annotations[i];
var tool = annot.tooltype;
......
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