have the app change the url bar on entry and exit into workspaces
authorSteve Hackbarth <stephenhackbarth@gmail.com>
Wed, 13 Aug 2014 16:31:51 +0000 (12:31 -0400)
committerSteve Hackbarth <stephenhackbarth@gmail.com>
Wed, 13 Aug 2014 16:31:51 +0000 (12:31 -0400)
lib/backbone-x/source/router.js
lib/enyo-x/source/views/workspace.js

index 725cf5e..a22723d 100644 (file)
@@ -8,21 +8,10 @@ white:true*/
   XM.BackboneRouter = Backbone.Router.extend({
 
     routes: {
-      "help": "help",    // #help
-      "workspace/:recordType/:id": "workspace",
-      "search/:query/p:page": "search"   // #search/kiwis/p7
-    },
-
-    help: function () {
-      console.log("help");
-    },
-
-    search: function (query, page) {
-      console.log("serach", query, page);
+      "workspace/:recordType/:id": "workspace"
     },
 
     workspace: function (recordType, id) {
-      console.log("workspace", recordType, id);
       var inEvent = {
         workspace: "XV." + recordType + "Workspace",
         id: id
index 2eae521..d7e2287 100644 (file)
@@ -514,6 +514,9 @@ trailing:true, white:true, strict: false*/
       } else {
         attrs[Klass.prototype.idAttribute] = recordId;
         this.setValue(Klass.findOrCreate(attrs));
+        XM.backboneRouter.navigate("workspace/" +
+          this.kind.substring(3).replace("Workspace", "") + "/" +
+          recordId);
       }
       _setBindings(this, "on");
       this.fetch();
@@ -854,6 +857,7 @@ trailing:true, white:true, strict: false*/
         model.revert();
       }
 
+      XM.backboneRouter.navigate("");
       if (model && model.hasLockKey && model.hasLockKey()) {
         model.releaseLock({
           success: function () {