From 853be0d1647c484641cda19b00b34ed4d626f8dc Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Tue, 11 Nov 2014 18:02:35 -0800 Subject: [PATCH] add button now mostly working for deployments --- planetstack/core/xoslib/static/js/xoslib/xosHelper.js | 7 +++++-- planetstack/core/xoslib/tools/make_defaults.py | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js index 11d97d6..0fc9496 100644 --- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js +++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js @@ -126,9 +126,12 @@ XOSApplication = Marionette.Application.extend({ addShower: function(detailName, collection_name, regionName, title) { var app=this; return function() { + model = new xos[collection_name].model(); detailViewClass = app[detailName]; - detailView = new detailViewClass(); + detailView = new detailViewClass({model: model}); app[regionName].show(detailView); + $("#xos-detail-button-box").show(); + $("#xos-listview-button-box").hide(); } }, @@ -341,7 +344,7 @@ XOSListView = Marionette.CompositeView.extend({ addClicked: function(e) { console.log("add"); e.preventDefault(); - this.app.Router.navigate("add" + firstCharUpper(this.collection.modelName)); + this.app.Router.navigate("add" + firstCharUpper(this.collection.modelName), {trigger: true}); }, initialize: function() { diff --git a/planetstack/core/xoslib/tools/make_defaults.py b/planetstack/core/xoslib/tools/make_defaults.py index 5a6a48f..ad5377c 100644 --- a/planetstack/core/xoslib/tools/make_defaults.py +++ b/planetstack/core/xoslib/tools/make_defaults.py @@ -12,7 +12,7 @@ import inspect from django.core import serializers import json -print "function xosdefault() {" +print "function xos_get_defaults() {" for c in dir(core.models): c = getattr(core.models,c) @@ -37,4 +37,5 @@ for c in dir(core.models): print " this." + classname + " = " + fields_json + ";" print "};" +print "xosdefaults = new xos_get_defaults();" -- 2.43.0