Commit b79ed9ed authored by Téo Vasseur's avatar Téo Vasseur

js : abort inits/updates when a view is off

parent b0db9ca0
......@@ -112,6 +112,8 @@ Builder.prototype = {
},
resizeGraph : function (graphSize) {
if (!graph.on) return;
var spSize = 100 - graphSize
document.getElementById("visu")
......
......@@ -284,6 +284,8 @@ Graph.prototype = {
*
* */
resize: function (div_width, div_height) {
if (!this.on) return;
var div = document.getElementById(this.id)
var speed = 0
......@@ -331,6 +333,8 @@ Graph.prototype = {
*
* */
update : function (speed) {
if (!this.on) return this;
speed = typeof speed !== 'undefined' ? speed : 500;
var startTime = new Date()
.getTime();
......@@ -725,6 +729,7 @@ Graph.prototype = {
*
* */
init: function () {
if (!this.on) return this;
this.build_graph()
.initAxis()
.initData()
......
......@@ -31,6 +31,8 @@ function Info(id, model, builder) {
Info.prototype = {
init : function () {
if (!this.on) return;
var self = this
try {
var parent = document.getElementById(this.id);
......@@ -197,6 +199,8 @@ Info.prototype = {
},
update: function () {
if (!this.on) return;
try {
this.init();
} catch(err) {
......
......@@ -127,6 +127,8 @@ List.prototype = {
* need to be done after each .vidjil file change
* */
init: function () {
if (!this.on) return;
try {
this.build_list()
this.build_data_list()
......@@ -343,6 +345,8 @@ List.prototype = {
* update all content for list and data list
* */
update: function () {
if (!this.on) return;
var startTime = new Date()
.getTime();
var elapsedTime = 0;
......@@ -383,6 +387,8 @@ List.prototype = {
* resize List view to match his div size
* */
resize: function () {
if (!this.on) return;
//hardcore resize (for firefox and ...)
//seriously 7 years after the first release of the html5 specs there is no simple way (except with chrome) to put a scrollbar inside a table-cell
......
......@@ -165,6 +165,8 @@ ScatterPlot.prototype = {
* */
init: function() {
console.log("ScatterPlot " + this.id + ": init()");
if (!this.on) return;
try {
document.getElementById(this.id)
......@@ -890,6 +892,8 @@ ScatterPlot.prototype = {
* @param {float} [div_height]
* */
resize: function(div_width, div_height) {
if (!this.on) return;
var print = true
if (typeof div_height == 'undefined') {
var div = document.getElementById(this.id)
......@@ -1144,6 +1148,8 @@ ScatterPlot.prototype = {
* update all elements (resize / clones positions / axis / menu / labels / system labels)
* */
update: function() {
if (!this.on) return;
var self = this;
try{
var startTime = new Date()
......
......@@ -90,6 +90,7 @@ Segment.prototype = {
* init the view before use
* */
init: function () {
if (!this.on) return;
this.build()
},
......
Markdown is supported
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