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