Gitlab CSE Unil

Commit 7ddd2d25 authored by M. Chardon's avatar M. Chardon
Browse files

buf affichage visu étudiant sur click sucessif d'un item

parent c3ad9fef
...@@ -1221,7 +1221,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1221,7 +1221,8 @@ Y.extend(ANNOTATION, Y.Base, {
return true; return true;
}, },
view_annot: function (e, clickType) { view_annot: function (e, clickType) {
if (!clickType || !(clickType === 'click')) { if (!clickType || !(clickType === 'click' && this.editor.currentannotationreview === this)) {
this.editor.currentannotationreview = this;
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
...@@ -1249,6 +1250,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1249,6 +1250,8 @@ Y.extend(ANNOTATION, Y.Base, {
divprincipale.detach(); divprincipale.detach();
divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside'); divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside');
} }
} else {
this.editor.currentannotationreview = null;
} }
}, },
edit_annot: function (e) { edit_annot: function (e) {
...@@ -5613,6 +5616,7 @@ EDITOR.prototype = { ...@@ -5613,6 +5616,7 @@ EDITOR.prototype = {
editingcomment: false, editingcomment: false,
annotationsparent: [], annotationsparent: [],
studentstatut: -1, studentstatut: -1,
currentannotationreview: null,
/** /**
* Called during the initialisation process of the object. * Called during the initialisation process of the object.
* @method initializer * @method initializer
...@@ -5962,7 +5966,7 @@ EDITOR.prototype = { ...@@ -5962,7 +5966,7 @@ EDITOR.prototype = {
var parentannot = []; var parentannot = [];
for (j = 0; j < this.pages[i].annotations.length; j++) { for (j = 0; j < this.pages[i].annotations.length; j++) {
data = this.pages[i].annotations[j]; data = this.pages[i].annotations[j];
Y.log('all_pages_loaded : ' + data.id + " - " +data.parent_annot); Y.log('all_pages_loaded : ' + data.id + " - " + data.parent_annot);
if (data.parent_annot && parseInt(data.parent_annot) !== 0) { if (data.parent_annot && parseInt(data.parent_annot) !== 0) {
data.parent_annot_element = parentannot[data.parent_annot]; data.parent_annot_element = parentannot[data.parent_annot];
} }
...@@ -6078,7 +6082,7 @@ EDITOR.prototype = { ...@@ -6078,7 +6082,7 @@ EDITOR.prototype = {
context: this context: this
}); });
}, },
update_student_feedback: function (){ update_student_feedback: function () {
this.refresh_pdf(); this.refresh_pdf();
}, },
update_visu_annotation: function () { update_visu_annotation: function () {
...@@ -6567,14 +6571,14 @@ EDITOR.prototype = { ...@@ -6567,14 +6571,14 @@ EDITOR.prototype = {
return new M.core.ajaxException(jsondata); return new M.core.ajaxException(jsondata);
} }
Y.one(SELECTOR.UNSAVEDCHANGESINPUT).set('value', 'true'); Y.one(SELECTOR.UNSAVEDCHANGESINPUT).set('value', 'true');
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('opacity', 1); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('opacity', 1);
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('display', 'inline-block'); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('display', 'inline-block');
Y.one(SELECTOR.UNSAVEDCHANGESDIV).transition({ Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).transition({
duration: 1, duration: 1,
delay: 2, delay: 2,
opacity: 0 opacity: 0
}, function () { }, function () {
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('display', 'none'); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('display', 'none');
}); });
} catch (e) { } catch (e) {
return new M.core.exception(e); return new M.core.exception(e);
......
...@@ -1221,7 +1221,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1221,7 +1221,8 @@ Y.extend(ANNOTATION, Y.Base, {
return true; return true;
}, },
view_annot: function (e, clickType) { view_annot: function (e, clickType) {
if (!clickType || !(clickType === 'click')) { if (!clickType || !(clickType === 'click' && this.editor.currentannotationreview === this)) {
this.editor.currentannotationreview = this;
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
...@@ -1249,6 +1250,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1249,6 +1250,8 @@ Y.extend(ANNOTATION, Y.Base, {
divprincipale.detach(); divprincipale.detach();
divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside'); divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside');
} }
} else {
this.editor.currentannotationreview = null;
} }
}, },
edit_annot: function (e) { edit_annot: function (e) {
...@@ -5609,6 +5612,7 @@ EDITOR.prototype = { ...@@ -5609,6 +5612,7 @@ EDITOR.prototype = {
editingcomment: false, editingcomment: false,
annotationsparent: [], annotationsparent: [],
studentstatut: -1, studentstatut: -1,
currentannotationreview: null,
/** /**
* Called during the initialisation process of the object. * Called during the initialisation process of the object.
* @method initializer * @method initializer
...@@ -6072,7 +6076,7 @@ EDITOR.prototype = { ...@@ -6072,7 +6076,7 @@ EDITOR.prototype = {
context: this context: this
}); });
}, },
update_student_feedback: function (){ update_student_feedback: function () {
this.refresh_pdf(); this.refresh_pdf();
}, },
update_visu_annotation: function () { update_visu_annotation: function () {
...@@ -6558,14 +6562,14 @@ EDITOR.prototype = { ...@@ -6558,14 +6562,14 @@ EDITOR.prototype = {
return new M.core.ajaxException(jsondata); return new M.core.ajaxException(jsondata);
} }
Y.one(SELECTOR.UNSAVEDCHANGESINPUT).set('value', 'true'); Y.one(SELECTOR.UNSAVEDCHANGESINPUT).set('value', 'true');
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('opacity', 1); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('opacity', 1);
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('display', 'inline-block'); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('display', 'inline-block');
Y.one(SELECTOR.UNSAVEDCHANGESDIV).transition({ Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).transition({
duration: 1, duration: 1,
delay: 2, delay: 2,
opacity: 0 opacity: 0
}, function () { }, function () {
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('display', 'none'); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('display', 'none');
}); });
} catch (e) { } catch (e) {
return new M.core.exception(e); return new M.core.exception(e);
......
...@@ -675,7 +675,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -675,7 +675,8 @@ Y.extend(ANNOTATION, Y.Base, {
return true; return true;
}, },
view_annot: function (e, clickType) { view_annot: function (e, clickType) {
if (!clickType || !(clickType === 'click')) { if (!clickType || !(clickType === 'click' && this.editor.currentannotationreview === this)) {
this.editor.currentannotationreview = this;
if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) { if (this.tooltype.type <= TOOLTYPE.COMMENTPLUS && !this.parent_annot_element) {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
...@@ -703,6 +704,8 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -703,6 +704,8 @@ Y.extend(ANNOTATION, Y.Base, {
divprincipale.detach(); divprincipale.detach();
divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside'); divprincipale.on('clickoutside', this.hide_edit, this, 'clickoutside');
} }
} else {
this.editor.currentannotationreview = null;
} }
}, },
edit_annot: function (e) { edit_annot: function (e) {
......
...@@ -188,6 +188,7 @@ EDITOR.prototype = { ...@@ -188,6 +188,7 @@ EDITOR.prototype = {
editingcomment: false, editingcomment: false,
annotationsparent: [], annotationsparent: [],
studentstatut: -1, studentstatut: -1,
currentannotationreview: null,
/** /**
* Called during the initialisation process of the object. * Called during the initialisation process of the object.
* @method initializer * @method initializer
...@@ -537,7 +538,7 @@ EDITOR.prototype = { ...@@ -537,7 +538,7 @@ EDITOR.prototype = {
var parentannot = []; var parentannot = [];
for (j = 0; j < this.pages[i].annotations.length; j++) { for (j = 0; j < this.pages[i].annotations.length; j++) {
data = this.pages[i].annotations[j]; data = this.pages[i].annotations[j];
Y.log('all_pages_loaded : ' + data.id + " - " +data.parent_annot); Y.log('all_pages_loaded : ' + data.id + " - " + data.parent_annot);
if (data.parent_annot && parseInt(data.parent_annot) !== 0) { if (data.parent_annot && parseInt(data.parent_annot) !== 0) {
data.parent_annot_element = parentannot[data.parent_annot]; data.parent_annot_element = parentannot[data.parent_annot];
} }
...@@ -653,7 +654,7 @@ EDITOR.prototype = { ...@@ -653,7 +654,7 @@ EDITOR.prototype = {
context: this context: this
}); });
}, },
update_student_feedback: function (){ update_student_feedback: function () {
this.refresh_pdf(); this.refresh_pdf();
}, },
update_visu_annotation: function () { update_visu_annotation: function () {
...@@ -1142,14 +1143,14 @@ EDITOR.prototype = { ...@@ -1142,14 +1143,14 @@ EDITOR.prototype = {
return new M.core.ajaxException(jsondata); return new M.core.ajaxException(jsondata);
} }
Y.one(SELECTOR.UNSAVEDCHANGESINPUT).set('value', 'true'); Y.one(SELECTOR.UNSAVEDCHANGESINPUT).set('value', 'true');
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('opacity', 1); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('opacity', 1);
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('display', 'inline-block'); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('display', 'inline-block');
Y.one(SELECTOR.UNSAVEDCHANGESDIV).transition({ Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).transition({
duration: 1, duration: 1,
delay: 2, delay: 2,
opacity: 0 opacity: 0
}, function () { }, function () {
Y.one(SELECTOR.UNSAVEDCHANGESDIV).setStyle('display', 'none'); Y.one(SELECTOR.UNSAVEDCHANGESDIVEDIT).setStyle('display', 'none');
}); });
} catch (e) { } catch (e) {
return new M.core.exception(e); return new M.core.exception(e);
......
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