{:uriI"Çfile:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/flag.js.coffee?type=application/javascript&pipeline=self&id=cf7fa21055a06f3551ad4a93402c2836e68da3d167dc800abc5b3870b3c3264a:ET:load_pathI"3/Users/marten/rgoc/quby/app/assets/javascripts;T: filenameI"W/Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/flag.js.coffee;T: nameI"quby/backbone/models/flag;T:logical_pathI"&quby/backbone/models/flag.self.js;T:content_typeI"application/javascript;T: sourceI"¨(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.Flag = (function(superClass) { extend(Flag, superClass); function Flag() { return Flag.__super__.constructor.apply(this, arguments); } Flag.prototype.defaults = function() { return { key: "", value: null, hidesQuestions: new Quby.Collections.Questions, showsQuestions: new Quby.Collections.Questions, hidesQuestionsKeys: [], showsQuestionsKeys: [], triggerOn: true }; }; Flag.prototype.initShowsHides = function(allQuestions) { var hidesQuestions, hidesQuestionsKeys, showsQuestions, showsQuestionsKeys; showsQuestionsKeys = this.get("showsQuestionsKeys"); showsQuestions = allQuestions.select(function(question) { return _.contains(showsQuestionsKeys, question.get("key")); }); this.get("showsQuestions").add(showsQuestions); hidesQuestionsKeys = this.get("hidesQuestionsKeys"); hidesQuestions = allQuestions.select(function(question) { return _.contains(hidesQuestionsKeys, question.get("key")); }); this.get("hidesQuestions").add(hidesQuestions); return this.doHiding(); }; Flag.prototype.doHiding = function() { var value; value = this.get("value"); if (value === this.get("triggerOn")) { this.hideQuestions(); return this.showQuestions(); } }; Flag.prototype.hideQuestions = function() { var flag; flag = this; return this.get("hidesQuestions").each(function(question) { return question.trigger("hide", flag); }); }; Flag.prototype.showQuestions = function() { var flag; flag = this; return this.get("showsQuestions").each(function(question) { return question.trigger("show", flag); }); }; return Flag; })(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"efile-digest:///Users/marten/rgoc/quby/app/assets/javascripts/quby/backbone/models/flag.js.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%@sjçCñc™´¥@˜Š‘wî ¤„VÌAuÕìÞ–Ç: lengthi¨:dependencies_digest"%b=êpoå 復†aÖ/46ž¬(åb¹ `_<Ì=:idI"Ecf7fa21055a06f3551ad4a93402c2836e68da3d167dc800abc5b3870b3c3264a;F: mtimel+´g,]