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