Skip to content
Snippets Groups Projects
Commit a0befbf2 authored by Andreas Valder's avatar Andreas Valder
Browse files

moved plot part to own object in moderator.js

parent 13890663
Branches
No related tags found
1 merge request!12Resolve "Hilfreichere Darstellung von Statistiken"
...@@ -250,19 +250,17 @@ var moderator = { ...@@ -250,19 +250,17 @@ var moderator = {
} }
} }
}, },
plots: {
init: function() { init: function() {
moderator.api.init(); $(window).on("resize", moderator.plots.resize);
moderator.editor.init(); $(".plotlyresize").on("click", moderator.plots.resize);
moderator.permissioneditor.init(); moderator.plots.createplots(".plot-view")
} },
}; resize: function() {
$(".plot-view").each(function () {Plotly.Plots.resize(this)});
$( document ).ready( function () { },
moderator.init(); createplots: function (selector) {
} ); var l = $(selector);
$( document ).ready( function () {
var l = $(".plot-view");
for (var i = 0; i < l.length; i ++) { for (var i = 0; i < l.length; i ++) {
if (!l[i].id) if (!l[i].id)
l[i].id = "plot-"+i; l[i].id = "plot-"+i;
...@@ -299,7 +297,16 @@ $( document ).ready( function () { ...@@ -299,7 +297,16 @@ $( document ).ready( function () {
} }
}); });
}; };
}); },
$(window).on("resize", function () { },
$(".plot-view").each(function () {Plotly.Plots.resize(this)}); init: function () {
moderator.api.init();
moderator.editor.init();
moderator.permissioneditor.init();
moderator.plots.init();
}
};
$( document ).ready( function () {
moderator.init();
} ); } );
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment