File tree Expand file tree Collapse file tree 1 file changed +14
-12
lines changed
www/addons/mod/wiki/controllers Expand file tree Collapse file tree 1 file changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -67,18 +67,20 @@ angular.module('mm.addons.mod_wiki')
6767
6868 $scope . gotoPage = function ( page ) {
6969 if ( ! page . id ) {
70- // It's an offline page.
71- var stateParams = {
72- module : module ,
73- moduleid : module . id ,
74- courseid : courseId ,
75- pagetitle : page . title ,
76- pageid : null ,
77- wikiid : wiki . id ,
78- subwikiid : page . subwikiid ,
79- action : 'page'
80- } ;
81- return $state . go ( 'site.mod_wiki' , stateParams ) ;
70+ // It's an offline page. Check if we are already in the same offline page.
71+ if ( currentPage || ! pageTitle || page . title != pageTitle ) {
72+ var stateParams = {
73+ module : module ,
74+ moduleid : module . id ,
75+ courseid : courseId ,
76+ pagetitle : page . title ,
77+ pageid : null ,
78+ wikiid : wiki . id ,
79+ subwikiid : page . subwikiid ,
80+ action : 'page'
81+ } ;
82+ return $state . go ( 'site.mod_wiki' , stateParams ) ;
83+ }
8284 } else if ( currentPage != page . id ) {
8385 // Add a new State.
8486 return fetchPageContents ( page . id ) . then ( function ( page ) {
You can’t perform that action at this time.
0 commit comments