Gitlab CSE Unil

Commit 48ad08c8 authored by M. Chardon's avatar M. Chardon
Browse files

but clickoutside // affichage de la popup à la création

parent 9ce719e9
...@@ -1079,7 +1079,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1079,7 +1079,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.cancel_edit, this); divprincipale.on('clickoutside', this.cancel_edit, this, 'clickoutside');
} }
}, },
fill_input_edition: function (e, unputtext) { fill_input_edition: function (e, unputtext) {
...@@ -1104,16 +1104,24 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1104,16 +1104,24 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit(); this.hide_edit();
this.apply_visibility_annot(); this.apply_visibility_annot();
}, },
cancel_edit: function () { cancel_edit: function (e, clickType) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref"); /*Y.log('cancel_edit : ' + clickType);
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput"); if (this.editor.currentannotation === this) {
if (valref) { Y.log('cancel_edit : mm');
var result = valref.get('value'); } else {
input.set('value', result); Y.log('cancel_edit : different');
}*/
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref");
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput");
if (valref) {
var result = valref.get('value');
input.set('value', result);
}
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
} }
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}, },
hide_edit: function () { hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
...@@ -3276,23 +3284,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, { ...@@ -3276,23 +3284,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
} }
}, },
hide_edit: function () { hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); ANNOTATIONFRAME.superclass.hide_edit.call(this);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil"); var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil");
var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd"); var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';'); divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
buttonrender.show(); buttonrender.show();
buttonadd.show(); buttonadd.show();
divdisplay.setStyle('z-index', 1);
this.enabled_canvas_event();
}, },
/** /**
* Delete an annotation * Delete an annotation
...@@ -6238,6 +6236,7 @@ EDITOR.prototype = { ...@@ -6238,6 +6236,7 @@ EDITOR.prototype = {
} }
this.currentdrawable = false; this.currentdrawable = false;
if (annotation.init_from_edit(this.currentedit)) { if (annotation.init_from_edit(this.currentedit)) {
this.currentannotation = annotation;
annotation.draw_catridge(this.currentedit); annotation.draw_catridge(this.currentedit);
annotation.edit_annot(); annotation.edit_annot();
this.pages[this.currentpage].annotations.push(annotation); this.pages[this.currentpage].annotations.push(annotation);
......
...@@ -1079,7 +1079,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1079,7 +1079,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.cancel_edit, this); divprincipale.on('clickoutside', this.cancel_edit, this, 'clickoutside');
} }
}, },
fill_input_edition: function (e, unputtext) { fill_input_edition: function (e, unputtext) {
...@@ -1104,16 +1104,21 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -1104,16 +1104,21 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit(); this.hide_edit();
this.apply_visibility_annot(); this.apply_visibility_annot();
}, },
cancel_edit: function () { cancel_edit: function (e, clickType) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref"); if (this.editor.currentannotation === this) {
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput"); } else {
if (valref) { }*/
var result = valref.get('value'); if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
input.set('value', result); var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref");
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput");
if (valref) {
var result = valref.get('value');
input.set('value', result);
}
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
} }
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}, },
hide_edit: function () { hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
...@@ -3273,23 +3278,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, { ...@@ -3273,23 +3278,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
} }
}, },
hide_edit: function () { hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); ANNOTATIONFRAME.superclass.hide_edit.call(this);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil"); var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil");
var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd"); var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';'); divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
buttonrender.show(); buttonrender.show();
buttonadd.show(); buttonadd.show();
divdisplay.setStyle('z-index', 1);
this.enabled_canvas_event();
}, },
/** /**
* Delete an annotation * Delete an annotation
...@@ -6230,6 +6225,7 @@ EDITOR.prototype = { ...@@ -6230,6 +6225,7 @@ EDITOR.prototype = {
} }
this.currentdrawable = false; this.currentdrawable = false;
if (annotation.init_from_edit(this.currentedit)) { if (annotation.init_from_edit(this.currentedit)) {
this.currentannotation = annotation;
annotation.draw_catridge(this.currentedit); annotation.draw_catridge(this.currentedit);
annotation.edit_annot(); annotation.edit_annot();
this.pages[this.currentpage].annotations.push(annotation); this.pages[this.currentpage].annotations.push(annotation);
......
...@@ -538,7 +538,7 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -538,7 +538,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.cancel_edit, this); divprincipale.on('clickoutside', this.cancel_edit, this, 'clickoutside');
} }
}, },
fill_input_edition: function (e, unputtext) { fill_input_edition: function (e, unputtext) {
...@@ -563,16 +563,24 @@ Y.extend(ANNOTATION, Y.Base, { ...@@ -563,16 +563,24 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit(); this.hide_edit();
this.apply_visibility_annot(); this.apply_visibility_annot();
}, },
cancel_edit: function () { cancel_edit: function (e, clickType) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref"); /*Y.log('cancel_edit : ' + clickType);
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput"); if (this.editor.currentannotation === this) {
if (valref) { Y.log('cancel_edit : mm');
var result = valref.get('value'); } else {
input.set('value', result); Y.log('cancel_edit : different');
}*/
if (!(clickType === 'clickoutside' && this.editor.currentannotation === this)) {
var valref = this.editor.get_dialogue_element('#' + this.divcartridge + "_valref");
var input = this.editor.get_dialogue_element('#' + this.divcartridge + "_editinput");
if (valref) {
var result = valref.get('value');
input.set('value', result);
}
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
} }
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}, },
hide_edit: function () { hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
......
...@@ -482,23 +482,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, { ...@@ -482,23 +482,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
} }
}, },
hide_edit: function () { hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge); ANNOTATIONFRAME.superclass.hide_edit.call(this);
var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display"); var divdisplay = this.editor.get_dialogue_element('#' + this.divcartridge + "_display");
var divedit = this.editor.get_dialogue_element('#' + this.divcartridge + "_edit");
var buttonsave = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonsave");
var buttoncancel = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttoncancel");
var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil"); var buttonrender = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonpencil");
var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd"); var buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';'); divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
buttonrender.show(); buttonrender.show();
buttonadd.show(); buttonadd.show();
divdisplay.setStyle('z-index', 1);
this.enabled_canvas_event();
}, },
/** /**
* Delete an annotation * Delete an annotation
......
...@@ -904,6 +904,7 @@ EDITOR.prototype = { ...@@ -904,6 +904,7 @@ EDITOR.prototype = {
} }
this.currentdrawable = false; this.currentdrawable = false;
if (annotation.init_from_edit(this.currentedit)) { if (annotation.init_from_edit(this.currentedit)) {
this.currentannotation = annotation;
annotation.draw_catridge(this.currentedit); annotation.draw_catridge(this.currentedit);
annotation.edit_annot(); annotation.edit_annot();
this.pages[this.currentpage].annotations.push(annotation); this.pages[this.currentpage].annotations.push(annotation);
......
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