Skip to content

Commit

Permalink
Card Colors stay the same from initial page load
Browse files Browse the repository at this point in the history
  • Loading branch information
raymonddavis committed Dec 20, 2016
1 parent 5a59ba9 commit 9ef8361
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 40 deletions.
24 changes: 4 additions & 20 deletions dist/slyckSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@

//End Event Listeners
},
load: function(data, caller) {
var temp = [];
temp = this.cards;
load: function(data) {
this.cards = [];
var rows = 0;
for (var a in data) {
Expand Down Expand Up @@ -359,7 +357,7 @@
stroke = this.cards[index].stroke;
}

if (typeof caller != 'undefined' && caller == 'filter') {
if(typeof this.backup != 'undefined') {
var t = -1;
for (var x in this.backup) {
if (this.backup[x].values.label == values.label) {
Expand All @@ -371,20 +369,6 @@
fill = this.backup[t].fill;
stroke = this.backup[t].stroke;
}
} else {
if (temp.length != 0) {
var t = -1;
for (var x in temp) {
if (temp[x].values.label == values.label) {
t = x;
break;
}
}
if (t >= 0) {
fill = temp[t].fill;
stroke = temp[t].stroke;
}
}
}

if (indexs.length > 0) {
Expand Down Expand Up @@ -487,13 +471,13 @@
},
filterCustom: function(data) {
this.filterItemCustom = data;
this.load(this.data, 'filter');
this.load(this.data);
this.clear();
this.draw();
},
filter: function(data) {
this.filterItem = data;
this.load(this.data, 'filter');
this.load(this.data);
this.clear();
this.draw();
},
Expand Down
24 changes: 4 additions & 20 deletions src/js/slyckSchedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@

//End Event Listeners
},
load: function(data, caller) {
var temp = [];
temp = this.cards;
load: function(data) {
this.cards = [];
var rows = 0;
for (var a in data) {
Expand Down Expand Up @@ -359,7 +357,7 @@
stroke = this.cards[index].stroke;
}

if (typeof caller != 'undefined' && caller == 'filter') {
if(typeof this.backup != 'undefined') {
var t = -1;
for (var x in this.backup) {
if (this.backup[x].values.label == values.label) {
Expand All @@ -371,20 +369,6 @@
fill = this.backup[t].fill;
stroke = this.backup[t].stroke;
}
} else {
if (temp.length != 0) {
var t = -1;
for (var x in temp) {
if (temp[x].values.label == values.label) {
t = x;
break;
}
}
if (t >= 0) {
fill = temp[t].fill;
stroke = temp[t].stroke;
}
}
}

if (indexs.length > 0) {
Expand Down Expand Up @@ -487,13 +471,13 @@
},
filterCustom: function(data) {
this.filterItemCustom = data;
this.load(this.data, 'filter');
this.load(this.data);
this.clear();
this.draw();
},
filter: function(data) {
this.filterItem = data;
this.load(this.data, 'filter');
this.load(this.data);
this.clear();
this.draw();
},
Expand Down

0 comments on commit 9ef8361

Please sign in to comment.