Browse Source

Fixed problem when timeline is reinitialized with new data it adds to the old data

pull/75/head
Zach Wise 13 years ago
parent
commit
84e025a3ed
  1. 6
      locale/de.js
  2. 6
      locale/en.js
  3. 6
      locale/es.js
  4. 6
      locale/fr.js
  5. 6
      locale/is.js
  6. 6
      locale/it.js
  7. 6
      locale/kr.js
  8. 6
      locale/nl.js
  9. 6
      locale/pt-br.js
  10. 6
      locale/zh-ch.js
  11. 6
      locale/zh-tw.js
  12. 25
      source/js/VMM.Slider.js
  13. 3
      source/js/VMM.Timeline.TimeNav.js
  14. 2
      source/js/VMM.Timeline.js
  15. 6
      timeline-min.js
  16. 30
      timeline.js

6
locale/de.js

File diff suppressed because one or more lines are too long

6
locale/en.js

File diff suppressed because one or more lines are too long

6
locale/es.js

File diff suppressed because one or more lines are too long

6
locale/fr.js

File diff suppressed because one or more lines are too long

6
locale/is.js

File diff suppressed because one or more lines are too long

6
locale/it.js

File diff suppressed because one or more lines are too long

6
locale/kr.js

File diff suppressed because one or more lines are too long

6
locale/nl.js

File diff suppressed because one or more lines are too long

6
locale/pt-br.js

File diff suppressed because one or more lines are too long

6
locale/zh-ch.js

File diff suppressed because one or more lines are too long

6
locale/zh-tw.js

File diff suppressed because one or more lines are too long

25
source/js/VMM.Slider.js

@ -8,7 +8,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
================================================== */
var events = {}, config;
// ARRAYS
var data = [], slides = [], medias = [], slide_positions = [];
var data = [], slides = [], slide_positions = [];
var slides_content = "";
var current_slide = 0;
var current_width = 960;
@ -54,31 +54,15 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
================================================== */
this.ver = "0.6";
/* APPLY SUPPLIED CONFIG
================================================== */
/*
if (type.of(parent_config) == 'object') {
var x;
for (x in parent_config) {
if (Object.prototype.hasOwnProperty.call(parent_config, x)) {
config[x] = parent_config[x];
}
}
} else if (type.of(_config) == 'object') {
var x;
for (x in _config) {
if (Object.prototype.hasOwnProperty.call(_config, x)) {
config[x] = _config[x];
}
}
}
*/
config.slider.width = config.width;
config.slider.height = config.height;
/* PUBLIC FUNCTIONS
================================================== */
this.init = function(d) {
slides = [];
slide_positions = [];
if(typeof d != 'undefined') {
this.setData(d);
} else {
@ -289,6 +273,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
// Clear out existing content
VMM.attachElement($slides_items, "");
slides = [];
for(var i = 0; i < d.length; i++) {
var bw = "";

3
source/js/VMM.Timeline.TimeNav.js

@ -62,6 +62,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
================================================== */
this.setData = function(d,e) {
if(typeof d != 'undefined') {
data = {};
data = d;
eras = e;
build();
@ -1027,6 +1028,8 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
var row = 2; //row
var lpos = 0; // last marker pos;
var row_depth = 0;
markers = [];
era_markers = [];
for(var i = 0; i < data.length; i++) {

2
source/js/VMM.Timeline.js

@ -57,7 +57,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
timeline_id = "#timeline";
}
version = "0.98.6";
version = "0.98.7";
trace("TIMELINE VERSION " + version);

6
timeline-min.js vendored

File diff suppressed because one or more lines are too long

30
timeline.js

@ -3186,7 +3186,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
================================================== */
var events = {}, config;
// ARRAYS
var data = [], slides = [], medias = [], slide_positions = [];
var data = [], slides = [], slide_positions = [];
var slides_content = "";
var current_slide = 0;
var current_width = 960;
@ -3232,31 +3232,15 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
================================================== */
this.ver = "0.6";
/* APPLY SUPPLIED CONFIG
================================================== */
/*
if (type.of(parent_config) == 'object') {
var x;
for (x in parent_config) {
if (Object.prototype.hasOwnProperty.call(parent_config, x)) {
config[x] = parent_config[x];
}
}
} else if (type.of(_config) == 'object') {
var x;
for (x in _config) {
if (Object.prototype.hasOwnProperty.call(_config, x)) {
config[x] = _config[x];
}
}
}
*/
config.slider.width = config.width;
config.slider.height = config.height;
/* PUBLIC FUNCTIONS
================================================== */
this.init = function(d) {
slides = [];
slide_positions = [];
if(typeof d != 'undefined') {
this.setData(d);
} else {
@ -3467,6 +3451,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Slider == 'undefined') {
// Clear out existing content
VMM.attachElement($slides_items, "");
slides = [];
for(var i = 0; i < d.length; i++) {
var bw = "";
@ -4873,7 +4858,7 @@ if(typeof VMM != 'undefined' && typeof VMM.Timeline == 'undefined') {
timeline_id = "#timeline";
}
version = "0.98.6";
version = "0.98.7";
trace("TIMELINE VERSION " + version);
@ -5474,6 +5459,7 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
================================================== */
this.setData = function(d,e) {
if(typeof d != 'undefined') {
data = {};
data = d;
eras = e;
build();
@ -6439,6 +6425,8 @@ if(typeof VMM.Timeline != 'undefined' && typeof VMM.Timeline.TimeNav == 'undefin
var row = 2; //row
var lpos = 0; // last marker pos;
var row_depth = 0;
markers = [];
era_markers = [];
for(var i = 0; i < data.length; i++) {

Loading…
Cancel
Save