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, {
input.set('focus', 'on');
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) {
......@@ -1104,7 +1104,14 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
this.apply_visibility_annot();
},
cancel_edit: function () {
cancel_edit: function (e, clickType) {
/*Y.log('cancel_edit : ' + clickType);
if (this.editor.currentannotation === this) {
Y.log('cancel_edit : mm');
} else {
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) {
......@@ -1114,6 +1121,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}
},
hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
......@@ -3276,23 +3284,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
}
},
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 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 buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
buttonrender.show();
buttonadd.show();
divdisplay.setStyle('z-index', 1);
this.enabled_canvas_event();
},
/**
* Delete an annotation
......@@ -6238,6 +6236,7 @@ EDITOR.prototype = {
}
this.currentdrawable = false;
if (annotation.init_from_edit(this.currentedit)) {
this.currentannotation = annotation;
annotation.draw_catridge(this.currentedit);
annotation.edit_annot();
this.pages[this.currentpage].annotations.push(annotation);
......
......@@ -1079,7 +1079,7 @@ Y.extend(ANNOTATION, Y.Base, {
input.set('focus', 'on');
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) {
......@@ -1104,7 +1104,11 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
this.apply_visibility_annot();
},
cancel_edit: function () {
cancel_edit: function (e, clickType) {
if (this.editor.currentannotation === this) {
} else {
}*/
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) {
......@@ -1114,6 +1118,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}
},
hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
......@@ -3273,23 +3278,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
}
},
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 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 buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
buttonrender.show();
buttonadd.show();
divdisplay.setStyle('z-index', 1);
this.enabled_canvas_event();
},
/**
* Delete an annotation
......@@ -6230,6 +6225,7 @@ EDITOR.prototype = {
}
this.currentdrawable = false;
if (annotation.init_from_edit(this.currentedit)) {
this.currentannotation = annotation;
annotation.draw_catridge(this.currentedit);
annotation.edit_annot();
this.pages[this.currentpage].annotations.push(annotation);
......
......@@ -538,7 +538,7 @@ Y.extend(ANNOTATION, Y.Base, {
input.set('focus', 'on');
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) {
......@@ -563,7 +563,14 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
this.apply_visibility_annot();
},
cancel_edit: function () {
cancel_edit: function (e, clickType) {
/*Y.log('cancel_edit : ' + clickType);
if (this.editor.currentannotation === this) {
Y.log('cancel_edit : mm');
} else {
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) {
......@@ -573,6 +580,7 @@ Y.extend(ANNOTATION, Y.Base, {
this.hide_edit();
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
divprincipale.detach();
}
},
hide_edit: function () {
var divprincipale = this.editor.get_dialogue_element('#' + this.divcartridge);
......
......@@ -482,23 +482,13 @@ Y.extend(ANNOTATIONFRAME, M.assignfeedback_editpdfplus.annotation, {
}
},
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 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 buttonadd = this.editor.get_dialogue_element('#' + this.divcartridge + "_buttonadd");
divdisplay.show();
divdisplay.set('style', 'display:inline;color:' + this.get_color() + ';');
divedit.hide();
buttonsave.hide();
buttoncancel.hide();
buttonrender.show();
buttonadd.show();
divdisplay.setStyle('z-index', 1);
this.enabled_canvas_event();
},
/**
* Delete an annotation
......
......@@ -904,6 +904,7 @@ EDITOR.prototype = {
}
this.currentdrawable = false;
if (annotation.init_from_edit(this.currentedit)) {
this.currentannotation = annotation;
annotation.draw_catridge(this.currentedit);
annotation.edit_annot();
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