pushNotice should work properly in Cosora now.

This commit is contained in:
Azareal 2019-04-29 08:27:58 +10:00
parent fd68578ed1
commit eaaf623e6f
1 changed files with 16 additions and 10 deletions

View File

@ -1,9 +1,20 @@
"use strict"; "use strict";
(() => { (() => {
console.log("bf") function moveAlerts() {
// Move the alerts under the first header
let colSel = $(".colstack_right .colstack_head:first");
let colSelAlt = $(".colstack_right .colstack_item:first");
let colSelAltAlt = $(".colstack_right .coldyn_block:first");
if(colSel.length > 0) $('.alert').insertAfter(colSel);
else if (colSelAlt.length > 0) $('.alert').insertBefore(colSelAlt);
else if (colSelAltAlt.length > 0) $('.alert').insertBefore(colSelAltAlt);
else $('.alert').insertAfter(".rowhead:first");
}
//console.log("bf")
addInitHook("end_init", () => { addInitHook("end_init", () => {
console.log("af") //console.log("af")
let loggedIn = document.head.querySelector("[property='x-loggedin']").content; let loggedIn = document.head.querySelector("[property='x-loggedin']").content;
if(loggedIn) { if(loggedIn) {
if(navigator.userAgent.indexOf("Firefox") != -1) $.trumbowyg.svgPath = "/static/trumbowyg/ui/icons.svg"; if(navigator.userAgent.indexOf("Firefox") != -1) $.trumbowyg.svgPath = "/static/trumbowyg/ui/icons.svg";
@ -103,15 +114,10 @@
document.getElementById("back").appendChild(buttonPane); document.getElementById("back").appendChild(buttonPane);
}); });
// Move the alerts under the first header moveAlerts();
let colSel = $(".colstack_right .colstack_head:first");
let colSelAlt = $(".colstack_right .colstack_item:first");
let colSelAltAlt = $(".colstack_right .coldyn_block:first");
if(colSel.length > 0) $('.alert').insertAfter(colSel);
else if (colSelAlt.length > 0) $('.alert').insertBefore(colSelAlt);
else if (colSelAltAlt.length > 0) $('.alert').insertBefore(colSelAltAlt);
else $('.alert').insertAfter(".rowhead:first");
}); });
addInitHook("after_notice", moveAlerts);
})(); })();
function newElement(etype, eclass) { function newElement(etype, eclass) {