From: Steve Hackbarth Date: Wed, 13 Aug 2014 16:31:51 +0000 (-0400) Subject: have the app change the url bar on entry and exit into workspaces X-Git-Tag: v4.7.0-beta.2~56^2~4 X-Git-Url: http://git.roojs.org/?p=xtuple;a=commitdiff_plain;h=803d7d5487d79b13678dd0ea7fbe09f1f728c001 have the app change the url bar on entry and exit into workspaces --- diff --git a/lib/backbone-x/source/router.js b/lib/backbone-x/source/router.js index 725cf5ee2..a22723d75 100644 --- a/lib/backbone-x/source/router.js +++ b/lib/backbone-x/source/router.js @@ -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 diff --git a/lib/enyo-x/source/views/workspace.js b/lib/enyo-x/source/views/workspace.js index 2eae52174..d7e228791 100644 --- a/lib/enyo-x/source/views/workspace.js +++ b/lib/enyo-x/source/views/workspace.js @@ -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 () {