add button now mostly working for deployments
authorScott Baker <smbaker@gmail.com>
Wed, 12 Nov 2014 02:02:35 +0000 (18:02 -0800)
committerScott Baker <smbaker@gmail.com>
Wed, 12 Nov 2014 02:02:35 +0000 (18:02 -0800)
planetstack/core/xoslib/static/js/xoslib/xosHelper.js
planetstack/core/xoslib/tools/make_defaults.py

index 11d97d6..0fc9496 100644 (file)
@@ -126,9 +126,12 @@ XOSApplication = Marionette.Application.extend({
     addShower: function(detailName, collection_name, regionName, title) {\r
         var app=this;\r
         return function() {\r
+            model = new xos[collection_name].model();\r
             detailViewClass = app[detailName];\r
-            detailView = new detailViewClass();\r
+            detailView = new detailViewClass({model: model});\r
             app[regionName].show(detailView);\r
+            $("#xos-detail-button-box").show();\r
+            $("#xos-listview-button-box").hide();\r
         }\r
     },\r
 \r
@@ -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});
              },
 \r
              initialize: function() {\r
index 5a6a48f..ad5377c 100644 (file)
@@ -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();"