{:uriI"Èfile:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/panel.js.coffee?type=application/javascript&pipeline=self&id=b80ef6e057df3a249493df7bdcbea50ce7951f8cb1e41cb126498c9574001607: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"Z (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, initedShowsHidesCalled: 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"rails-env;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"%çs‹ÿÆó\ÜŽ€µñ†_ˆ£«ÐH<üWðnàÈÂÔ : lengthiZ :dependencies_digest"%Ÿ‹Õ¯®U|P‡\e<|~QƉ!Ö%µ^§µuÃt÷:idI"Eb80ef6e057df3a249493df7bdcbea50ce7951f8cb1e41cb126498c9574001607;F: mtimel+Ï:^