Sha256: 9967aa36abf3b78b9e4e9502819af9810533917cde3103d6344da22edbdf37f2

Contents?: true

Size: 1.67 KB

Versions: 50

Compression:

Stored size: 1.67 KB

Contents

I"¦(function() {
  var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
    hasProp = {}.hasOwnProperty;

  Quby.Views.QuestionView = (function(superClass) {
    extend(QuestionView, superClass);

    function QuestionView() {
      return QuestionView.__super__.constructor.apply(this, arguments);
    }

    QuestionView.prototype.initialize = function() {
      this.model.on("decideVisibility", this.decideVisibility, this);
      if (this.model.get("defaultInvisible")) {
        return this.decideVisibility();
      }
    };

    QuestionView.prototype.decideVisibility = function() {
      if (this.isVisible()) {
        this.$el.addClass("show");
        if (this.$el.is(".select")) {
          this.$el.find('option').removeAttr("disabled");
        }
        return this.$el.removeClass("hide");
      } else {
        this.$el.addClass("hide");
        if (this.$el.is(".select")) {
          this.$el.find('option').attr("disabled", "disabled");
        }
        return this.$el.removeClass("show");
      }
    };

    QuestionView.prototype.isVisible = function() {
      return this.shown() || (!this.hidden() && !this.model.get("defaultInvisible"));
    };

    QuestionView.prototype.shown = function() {
      return !this.model.get("shownByOptions").isEmpty();
    };

    QuestionView.prototype.hidden = function() {
      return !this.model.get("hiddenByOptions").isEmpty();
    };

    return QuestionView;

  })(Backbone.View);

}).call(this);
:ET

Version data entries

50 entries across 29 versions & 1 rubygems

Version Path
quby-5.6.5 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.6.3 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.6.0 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.5.0 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.3.0 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.2.0 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.3 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.3 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.2 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.2 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.1 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.1 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.0 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.1.0 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.0.5 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.0.5 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.0.4 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.0.4 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.0.3 spec/internal/tmp/cache/assets/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache
quby-5.0.2 spec/internal/tmp/cache/assets/test/sprockets/v3.0/NF/NFGbE1Cj3IY7QzLyODTWSWcsu6JdHyjAz_dLDXv3Nlo.cache