Sha256: 0aca1db17a1c0a4f3ee56f390db86d88287b494d3eb7727644646182146db0f5
Contents?: true
Size: 1.08 KB
Versions: 34
Compression:
Stored size: 1.08 KB
Contents
class Quby.Models.Flag extends Backbone.Model defaults: -> key: "" value: null hidesQuestions: new Quby.Collections.Questions showsQuestions: new Quby.Collections.Questions hidesQuestionsKeys: [] showsQuestionsKeys: [] triggerOn: true initShowsHides: (allQuestions)-> showsQuestionsKeys = @get("showsQuestionsKeys") showsQuestions = allQuestions.select( (question) -> _.contains(showsQuestionsKeys, question.get("key")) ) @get("showsQuestions").add(showsQuestions) hidesQuestionsKeys = @get("hidesQuestionsKeys") hidesQuestions = allQuestions.select( (question) -> _.contains(hidesQuestionsKeys, question.get("key")) ) @get("hidesQuestions").add(hidesQuestions) @doHiding() doHiding: -> value = @get("value") if value == @get("triggerOn") @hideQuestions() @showQuestions() hideQuestions: -> flag = @ @get("hidesQuestions").each (question) -> question.trigger "hide", flag showQuestions: -> flag = @ @get("showsQuestions").each (question) -> question.trigger "show", flag
Version data entries
34 entries across 34 versions & 1 rubygems