<commit_before>/*
 * slipNslide Mobile Slider
 *
 * <NAME>, Prime
 * Copyright 2011, Licensed GPL & MIT
 *
*/

window.slipNslide = function(element, options) {

  // reference dom elements
  this.container = element;
  this.element = this.container.getElementsByTagName('ul')[0]; // the slide pane
  this.slides = this.element.getElementsByTagName('li');

  // retreive options
  this.options = options || {};
  this.index = this.options.startSlide || 0;
  this.speed = this.options.speed || 300;
  this.slidesPer = this.options.slidesPer || 0;

  // static css
  this.container.style.overflow = 'hidden';
  this.element.style.listStyle = 'none';

  this.setup();

  this.callback = this.options.callback || function() {};

  this.element.addEventListener('touchstart', this, false);
  this.element.addEventListener('touchmove', this, false);
  this.element.addEventListener('touchend', this, false);
  this.element.addEventListener('webkitTransitionEnd', this, false);
  window.addEventListener('resize', this, false);

}

slipNslide.prototype = {

  setup: function() {

    this.container.style.visibility = 'hidden';

    this.width = this.container.getBoundingClientRect().width;
    this.slideWidth = !this.slidesPer ? this.slides[0].getBoundingClientRect().width : this.width/this.slidesPer;

    // dynamic css
    this.element.style.width = (this.slides.length * this.slideWidth) + 'px';
    var index = this.slides.length;
    while (index--) {
      var el = this.slides[index];
      el.style.width = this.slideWidth + 'px';
      el.style.display = 'inline-block';
    }

    this.slide(this.index, 0); // set start position and force translate to remove initial flickering

    this.container.style.visibility = 'visible';

  },
<commit_msg>fixed issue with slides not resizing with view<commit_after>/*
 * slipNslide Mobile Slider
 *
 * <NAME>, Prime
 * Copyright 2011, Licensed GPL & MIT
 *
*/

window.slipNslide = function(element, options) {

  // reference dom elements
  this.container = element;
  this.element = this.container.getElementsByTagName('ul')[0]; // the slide pane
  this.slides = this.element.getElementsByTagName('li');

  // retreive options
  this.options = options || {};
  this.index = this.options.startSlide || 0;
  this.speed = this.options.speed || 300;
  this.slidesPer = this.options.slidesPer || 0;

  // static css
  this.container.style.overflow = 'hidden';
  this.element.style.listStyle = 'none';

  this.setup();

  this.callback = this.options.callback || function() {};

  this.element.addEventListener('touchstart', this, false);
  this.element.addEventListener('touchmove', this, false);
  this.element.addEventListener('touchend', this, false);
  this.element.addEventListener('webkitTransitionEnd', this, false);
  window.addEventListener('resize', this, false);

}

slipNslide.prototype = {

  setup: function() {

    this.container.style.visibility = 'hidden';

    this.width = this.container.getBoundingClientRect().width;
    this.slideWidth = !this.slidesPer ? this.width : this.width/this.slidesPer;

    // dynamic css
    this.element.style.width = (this.slides.length * this.slideWidth) + 'px';
    var index = this.slides.length;
    while (index--) {
      var el = this.slides[index];
      el.style.width = this.slideWidth + 'px';
      el.style.display = 'inline-block';
    }

    this.slide(this.index, 0); // set start position and force translate to remove initial flickering

    this.container.style.visibility = 'visible';

  },

{'fraction_non_alphanumeric': 0.14534055286406383, 'fraction_numerical': 0.006554573952693075, 'mean_word_length': 3.692513368983957, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3044146', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1059, 'n_words': 223}