{:uriI"file:///Users/henk/roqua/quby_engine/app/assets/javascripts/quby/backbone/models/flag.js.coffee?type=application/javascript&pipeline=self&id=b74fbc8f366a9e918893d0c5c11072476e8107aba8fd31feaa23bc523bbcddaa:ET:load_pathI"9/Users/henk/roqua/quby_engine/app/assets/javascripts;T: filenameI"]/Users/henk/roqua/quby_engine/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"rails-env;TTI"jprocessors:type=application/javascript&file_type=application/javascript&engines=.coffee&pipeline=self;TTI"kfile-digest:///Users/henk/roqua/quby_engine/app/assets/javascripts/quby/backbone/models/flag.js.coffee;TTF: requiredo;;}F: stubbedo;;}F: linkso;;}F: charsetI" utf-8;F: digest"%@sjCc@w VAuޖ: lengthi:dependencies_digest"%wLNvtUi$䗬Y3&l@:idI"Eb74fbc8f366a9e918893d0c5c11072476e8107aba8fd31feaa23bc523bbcddaa;F: mtimel+:vT