@@ -8,14 +8,18 @@ Vue.use(Vuex)
88const store = new Vuex . Store ( {
99 state : {
1010 pageTemplate : null ,
11- currentPath : document . location . pathname
11+ currentPathName : document . location . pathname ,
12+ currentSearch : document . location . search ,
13+ currentOrigin : document . location . origin
1214 } ,
1315 mutations : {
1416 setPageTemplate ( state , serverResponse ) {
1517 state . pageTemplate = serverResponse
1618 } ,
17- setCurrentPath ( state , path ) {
18- state . currentPath = path
19+ setCurrentLocation ( state , current ) {
20+ state . currentPathName = current . path
21+ state . currentSearch = current . search
22+ state . currentOrigin = current . origin
1923 }
2024 } ,
2125 actions : {
@@ -46,7 +50,7 @@ const store = new Vuex.Store({
4650 setTimeout ( function ( ) {
4751 resolve ( response [ "data" ] )
4852 commit ( 'setPageTemplate' , response [ "data" ] )
49- commit ( 'setCurrentPath ' , url )
53+ commit ( 'setCurrentLocation ' , { path : url , search : document . location . search , origin : document . location . origin } )
5054 matestackEventHub . $emit ( "page_loaded" , url ) ;
5155 if ( typeof matestackUiCoreTransitionSuccess !== 'undefined' ) {
5256 matestackUiCoreTransitionSuccess ( url ) ;
0 commit comments