From c29a5363e3e4e0833e78958fe95b52811d0b0660 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Wed, 26 Aug 2015 18:42:13 -0400 Subject: surface blueprints on layouts modal --- public/assets/javascripts/ui/site/LayoutsModal.js | 221 ++-------------------- 1 file changed, 13 insertions(+), 208 deletions(-) (limited to 'public/assets/javascripts/ui/site/LayoutsModal.js') diff --git a/public/assets/javascripts/ui/site/LayoutsModal.js b/public/assets/javascripts/ui/site/LayoutsModal.js index a9c6ef0..0222077 100644 --- a/public/assets/javascripts/ui/site/LayoutsModal.js +++ b/public/assets/javascripts/ui/site/LayoutsModal.js @@ -1,224 +1,35 @@ - -var LayoutsIndex = View.extend({ - - initialize: function(){ - this.$templates = this.$(".templates") - this.$templatesList = this.$(".templates-list") - this.$noTemplates = this.$(".no-templates") - this.$form = this.$("form") - - this.$userTemplatesList = this.$(".userTemplatesList") - this.$blueprintsList = this.$(".blueprintsList") - this.$newBlueprintButton = this.$("[data-role='create-new-blueprint']") - }, - - load: function(type){ - this.$templates.children("span").remove() - - $.get(this.action, this.populate.bind(this)) - }, - - populate: function(data){ - if (! data.layouts.length) { - this.$templates.hide() - this.$form.hide() - this.$noTemplates.show() - } - this.$templatesList.empty() - data.layouts.forEach(function(room){ - var $span = $("") - $span.data("slug", room.slug) - - var $label = $("