{:uriI"file:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/panel.js.coffee?type=application/javascript&pipeline=self&id=3c58ffdb86b49fa87f60d7c92ae1c0131bae3135a5307a93dabde07471a59d4a:ET:load_pathI"3/Users/marten/rgoc/quby/app/assets/javascripts;T: filenameI"X/Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/panel.js.coffee;T: nameI"quby/backbone/models/panel;T:logical_pathI"'quby/backbone/models/panel.self.js;T:content_typeI"application/javascript;T: sourceI"X (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.Models.Panel = (function(superClass) { extend(Panel, superClass); function Panel() { return Panel.__super__.constructor.apply(this, arguments); } Panel.prototype.defaults = function() { return { questions: new Quby.Collections.Questions, view: new Quby.Views.PanelView({ model: this }), panelId: null, initShowsHidesCalled: false }; }; Panel.prototype.initialize = function() { var hidePanelTrigger, panelId, viewSelector; panelId = this.get('panelId'); viewSelector = "#" + panelId; if (panelId) { this.get("view").setElement($(viewSelector)[0]); } hidePanelTrigger = function() { return this.trigger("hidePanelCheck"); }; this.get("questions").on("hide", hidePanelTrigger, this); this.get("questions").on("unhide", hidePanelTrigger, this); this.get("questions").on("show", hidePanelTrigger, this); this.get("questions").on("unshow", hidePanelTrigger, this); this.on("hidePanelCheck", this.hidePanelCheck, this); return this.trigger("hidePanelCheck"); }; Panel.prototype.initShowsHides = function(allQuestions) { if (!this.get('initedShowsHidesCalled')) { this.set('initedShowsHidesCalled', true); return this.get("questions").each(function(question) { var options; options = question.get("options"); return options.each(function(option) { return option.initShowsHides(allQuestions); }); }); } }; Panel.prototype.hidePanelCheck = function() { if (this.hidden()) { if (!this.get("questions").noneVisible()) { return this.trigger("unhide"); } } else { if (this.get("questions").noneVisible()) { return this.trigger("hide"); } } }; Panel.prototype.hidden = function() { return this.get("view").hidden(); }; return Panel; })(Backbone.Model); }).call(this); ;T: metadata{ :dependencieso:Set: @hash} I"environment-version;TTI"environment-paths;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"ffile-digest:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/panel.js.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%x~פ6><vСe˶uR: lengthiX :dependencies_digest"%n5Z*K,ꋷ{}%}ᲆ:idI"E3c58ffdb86b49fa87f60d7c92ae1c0131bae3135a5307a93dabde07471a59d4a;F: mtimel+g,]