-
Notifications
You must be signed in to change notification settings - Fork 160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix 3513: supprime la supperposition des aides markdown #3521
Conversation
@@ -289,7 +290,9 @@ | |||
|
|||
if (currentButton.action) { // Button with a submenu | |||
elemButton.style.position = "relative"; | |||
|
|||
if (this.currentElemPopup){ | |||
$(this.currentElemPopup).remove(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jQuery est pas dispo dans ce scope via $. Le mieux, c'est de pas l'utiliser:
if (this.currentElemPopup){
- $(this.currentElemPopup).remove();
+ elemButton.removeChild(this.currentElemPopup);
+ this.currentElemPopup = null;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrigé, merci.
Sorry, j'avais pas testé le code. Voici le patch qui corrige le bug: diff --git a/assets/js/editor.js b/assets/js/editor.js
index 440e430..e7744c3 100644
--- a/assets/js/editor.js
+++ b/assets/js/editor.js
@@ -231,6 +231,7 @@
setup: function(textareaId) {
var elemTexta = document.getElementById(textareaId);
var elemTools = document.createElement("ul");
+ var self = this;
elemTools.className = "zform-toolbar hide-for-small";
elemTexta.parentNode.insertBefore(elemTools, elemTexta);
@@ -248,6 +249,8 @@
while (menus[i]) {
if (menus[i].getAttribute("data-zform-info") !== "dontclose" || event.target.nodeName.toLowerCase() === "textarea") {
menus[i].style.display = "none";
+ if (menus[i] == self.currentElemPopup)
+ self.currentElemPopup = null;
}
i++;
}
@@ -289,16 +292,21 @@
if (currentButton.hasOwnProperty("image")) elemButton.innerHTML = '<img src="' + currentButton.image + '" alt="' + currentButton.title + '" />';
if (currentButton.action) { // Button with a submenu
+ var self = this;
elemButton.style.position = "relative";
- if (this.currentElemPopup){
- elemButton.removeChild(this.currentElemPopup);
- this.currentElemPopup = null;
- }
this.addEvent(elemButton, "click", function(event, elemPopup) {
event.preventDefault();
if (elemPopup = this.getElementsByTagName("div")[0]) {
elemPopup.style.display = "block";
+
+ if(self.currentElemPopup)
+ self.currentElemPopup.style.display = "none";
+
+ if(self.currentElemPopup == elemPopup)
+ self.currentElemPopup = null;
+ else
+ self.currentElemPopup = elemPopup;
}
});
@@ -311,7 +319,6 @@
elemPopup.style.whiteSpace = "nowrap";
elemPopup.style.textAlign = "left";
elemPopup = this[currentButton.action](elemPopup, currentButton, opts.textarea);
- this.currentElemPopup = elemPopup;
} else {
this.addEvent(elemButton, "click", (function(_button, _textareaId, _this, _tagtype, _extraoption) {
return function(event) { |
ok |
Done. |
QA : On est bon ici 👍 |
QA