-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouter.js
More file actions
27 lines (25 loc) · 1.01 KB
/
Copy pathRouter.js
File metadata and controls
27 lines (25 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
jQuery.sap.require("sap.ui.core.routing.Router");
jQuery.sap.require("sap.m.routing.RouteMatchedHandler");
sap.ui.core.routing.Router.extend("SapUI5Tutorial.Router",{
constructor:function(){
sap.ui.core.routing.Router.apply(this,arguments);
this.oRouteMatchedHandler = new sap.m.routing.RouteMatchedHandler(this);
},
myNavBack:function(sRoute,mData){
var oHistory = sap.ui.core.routing.History.getInstance();
var sUrl = this.getURL(sRoute,mData);
var sDirection = oHistory.getDirection(sUrl);
if("Backwards" === sDirection){
window.history.go(-1);
} else {
var bReplace = true;
this.navTo(sRoute,mData,bReplace);
}
},
myNavToWithoutHash:function(viewName,viewType,master,data){
var appView = sap.ui.getCore().byId("masterAppView");
var oView = this.getView(viewName,viewType);
appView.addPage(oView,master);
appView.to(oView.getId(),"show",data);
}
});