fix the issue with menu items appearing in the wrong order

pull/142/head
nightwing 2015-09-01 00:08:08 +04:00
rodzic ec5d7b653e
commit f0b760b2c4
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -954,10 +954,17 @@ apf.menu = function(struct, tagName){
};
this.$initChildren = function() {
this.childNodes.forEach(function(amlNode) {
var ch = this.childNodes;
for (var i = 0; i < ch.length; i++) {
var amlNode = ch[i];
if (!amlNode.$amlLoaded)
amlNode.dispatchEvent("DOMNodeInsertedIntoDocument");
});
// sometimes DOMNodeInsertedIntoDocument event handler puts $ext at the end of the popup
if (amlNode.previousSibling && amlNode.previousSibling.$ext && amlNode.$ext)
if (amlNode.$ext.previousSibling != amlNode.previousSibling.$ext)
if (amlNode.$ext.parentNode == amlNode.previousSibling.$ext.parentNode)
amlNode.$ext.parentNode.insertBefore(amlNode.$ext, amlNode.previousSibling.$ext.nextSibling);
}
};
var insertBefore = this.insertBefore;
this.insertBefore = function(node, beforeNode) {