Gitlab CSE Unil

Commit 4af7dbd0 authored by M. Chardon's avatar M. Chardon
Browse files

correction bug sauver après clickoutside

parent 2e7ee676
...@@ -1581,7 +1581,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1581,7 +1581,7 @@ Y.extend(ANNOTATION, Y.Base, {
input.set('focus', 'on'); input.set('focus', 'on');
} }
this.disabled_canvas_event(); this.disabled_canvas_event();
divprincipale.on('clickoutside', this.save_annot, this, 'clickoutside'); divprincipale.on('clickoutside', this.save_annot_clickout, this, 'clickoutside');
} }
}, },
/** /**
...@@ -1596,6 +1596,12 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1596,6 +1596,12 @@ Y.extend(ANNOTATION, Y.Base, {
} }
this.save_annot(unputtext); this.save_annot(unputtext);
}, },
save_annot_clickout: function (e, clickType) {
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
this.save_annot(null);
}
return;
},
/** /**
* save text annotation * save text annotation
* @param {string} result * @param {string} result
...@@ -1694,8 +1700,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1694,8 +1700,8 @@ Y.extend(ANNOTATION, Y.Base, {
} }
if (divprincipale) { if (divprincipale) {
divprincipale.setStyle('z-index', 1); divprincipale.setStyle('z-index', 1);
if (this.editor.get('readonly')) {
divprincipale.detach(); divprincipale.detach();
if (this.editor.get('readonly')) {
divprincipale.on('click', this.view_annot, this, 'click'); divprincipale.on('click', this.view_annot, this, 'click');
} }
} }
......
...@@ -1581,7 +1581,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1581,7 +1581,7 @@ Y.extend(ANNOTATION, Y.Base, {
input.set('focus', 'on'); input.set('focus', 'on');
} }
this.disabled_canvas_event(); this.disabled_canvas_event();
divprincipale.on('clickoutside', this.save_annot, this, 'clickoutside'); divprincipale.on('clickoutside', this.save_annot_clickout, this, 'clickoutside');
} }
}, },
/** /**
...@@ -1596,6 +1596,12 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1596,6 +1596,12 @@ Y.extend(ANNOTATION, Y.Base, {
} }
this.save_annot(unputtext); this.save_annot(unputtext);
}, },
save_annot_clickout: function (e, clickType) {
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
this.save_annot(null);
}
return;
},
/** /**
* save text annotation * save text annotation
* @param {string} result * @param {string} result
...@@ -1694,8 +1700,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1694,8 +1700,8 @@ Y.extend(ANNOTATION, Y.Base, {
} }
if (divprincipale) { if (divprincipale) {
divprincipale.setStyle('z-index', 1); divprincipale.setStyle('z-index', 1);
if (this.editor.get('readonly')) {
divprincipale.detach(); divprincipale.detach();
if (this.editor.get('readonly')) {
divprincipale.on('click', this.view_annot, this, 'click'); divprincipale.on('click', this.view_annot, this, 'click');
} }
} }
......
...@@ -1033,7 +1033,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1033,7 +1033,7 @@ Y.extend(ANNOTATION, Y.Base, {
input.set('focus', 'on'); input.set('focus', 'on');
} }
this.disabled_canvas_event(); this.disabled_canvas_event();
divprincipale.on('clickoutside', this.save_annot, this, 'clickoutside'); divprincipale.on('clickoutside', this.save_annot_clickout, this, 'clickoutside');
} }
}, },
/** /**
...@@ -1048,6 +1048,12 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1048,6 +1048,12 @@ Y.extend(ANNOTATION, Y.Base, {
} }
this.save_annot(unputtext); this.save_annot(unputtext);
}, },
save_annot_clickout: function (e, clickType) {
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
this.save_annot(null);
}
return;
},
/** /**
* save text annotation * save text annotation
* @param {string} result * @param {string} result
...@@ -1146,8 +1152,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1146,8 +1152,8 @@ Y.extend(ANNOTATION, Y.Base, {
} }
if (divprincipale) { if (divprincipale) {
divprincipale.setStyle('z-index', 1); divprincipale.setStyle('z-index', 1);
if (this.editor.get('readonly')) {
divprincipale.detach(); divprincipale.detach();
if (this.editor.get('readonly')) {
divprincipale.on('click', this.view_annot, this, 'click'); divprincipale.on('click', this.view_annot, this, 'click');
} }
} }
......
Supports Markdown
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