Skip to content

Commit

Permalink
Item13069: clear twisty store on page change
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDaum committed Jul 17, 2015
1 parent 1651f2e commit b2f2bc2
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 1 deletion.
7 changes: 7 additions & 0 deletions .gitignore
Expand Up @@ -9,3 +9,10 @@ pub/System/AngularSkin/settings.js
pub/System/AngularSkin/controller.js
*.jslint
attic
AngularSkin.md5
AngularSkin.sha1
AngularSkin.tgz
AngularSkin.txt
AngularSkin.zip
AngularSkin_installer
AngularSkin_installer.pl
1 change: 1 addition & 0 deletions lib/Foswiki/Contrib/AngularSkin/MANIFEST
Expand Up @@ -26,3 +26,4 @@ pub/System/AngularSkin/settings.js 0644
pub/System/AngularSkin/settings.js.gz 0644
pub/System/AngularSkin/settings.uncompressed.js 0644
templates/foswiki.angular.tmpl 0644
templates/view.angular.pattern.tmpl 0644
11 changes: 11 additions & 0 deletions pub/System/AngularSkin/controller.uncompressed.js
Expand Up @@ -121,7 +121,18 @@ app.controller("ViewCtrl", [
// success
function(data) {
blockLocationChange = false;

// clear twisty store
if (typeof(foswiki.TwistyPlugin) !== 'undefined') {
angular.element(".twistyContent").hide();
foswiki.TwistyPlugin._storage = {};
}

// scroll to top
$window.scrollTo(0, 0);

// TODO: close open modal dialogs

$scope.$broadcast("foswiki.pageLoaded");
},

Expand Down
11 changes: 11 additions & 0 deletions pub/System/AngularSkin/pkg.uncompressed.js
Expand Up @@ -329,7 +329,18 @@ app.controller("ViewCtrl", [
// success
function(data) {
blockLocationChange = false;

// clear twisty store
if (typeof(foswiki.TwistyPlugin) !== 'undefined') {
angular.element(".twistyContent").hide();
foswiki.TwistyPlugin._storage = {};
}

// scroll to top
$window.scrollTo(0, 0);

// TODO: close open modal dialogs

$scope.$broadcast("foswiki.pageLoaded");
},

Expand Down
2 changes: 1 addition & 1 deletion templates/foswiki.angular.tmpl
Expand Up @@ -39,7 +39,7 @@ jQuery.extend(foswiki.preferences, {
%TMPL:DEF{"css::angular"}%%ADDTOZONE{
"head"
id="ANGULARPLUGIN::CSS"
text="<link rel='stylesheet' type='text/css' href='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/pkg.css' media='all' >"
text="<link rel='stylesheet' type='text/css' href='%PUBURLPATH%/%SYSTEMWEB%/AngularSkin/pkg.css' media='all' />"
}%%TMPL:END%

%TMPL:DEF{"ng::loadtime"}%<div class="ngLoadTime" ng-if="loadTime" ng-bind-template="{{loadTime}} ms"></div>%TMPL:END%
42 changes: 42 additions & 0 deletions templates/view.angular.pattern.tmpl
@@ -0,0 +1,42 @@
%TMPL:INCLUDE{"view"}%

%TMPL:DEF{"htmldoctype"}%<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="%LANG%" lang="%LANG%" %TMPL:P{"ngapp"}% %TMPL:P{"ngcontroller"}%>%TMPL:END%
%TMPL:DEF{"windowtitle"}%<title class="foswikiContents" name="windowtitle::contents" type="plain">%TMPL:P{"windowtitle::contents"}%</title>%TMPL:END%
%TMPL:DEF{"windowtitle::contents"}%%TMPL:P{"titleaction"}% <nop>%BASETOPIC%%TMPL:P{"titlesep"}%%BASEWEB%%TMPL:P{"titlesep"}%<nop>%WIKITOOLNAME%%TMPL:END%

%TMPL:DEF{"sidebar"}%<div id="patternSideBar"><div id="patternClearHeaderLeft"></div>
<div id="patternSideBarContents" class="foswikiContents" name="websidebar" reload="web">
%TMPL:P{"websidebar"}%
</div></div>%TMPL:END%

%TMPL:DEF{"main"}%<div class="foswikiPage">
<div id="patternScreen">
<div id="patternPageShadow">%TMPL:P{"topbar"}%
<div id="patternPage">%TMPL:P{"startsidebarwrapper"}%
<div id="patternOuter">
<div id="patternFloatWrap">
<div id="patternMain">%TMPL:P{"topbarspacer"}%
<div id="patternMainContents" class="foswikiContents" name="patterntopiccontents">%TMPL:P{"patterntopiccontents"}%</div>
</div>%TMPL:P{"sidebar"}%
</div>
<div class="clear">&nbsp;</div>
</div>%TMPL:P{"endsidebarwrapper"}%%TMPL:P{"bottombar"}%
</div>
</div>
</div>
</div>%TMPL:P{"javascript::angular"}%%TMPL:P{"css::angular"}%%TMPL:END%

%TMPL:DEF{"head:meta"}%<meta charset="%CHARSET%" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.5, user-scalable=yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="icon" href="%FAVICON%" type="image/x-icon" />
<link rel="shortcut icon" href="%FAVICON%" type="image/x-icon" />
<link rel="alternate" href="%SCRIPTURL{edit}%/%BASEWEB%/%BASETOPIC%?t=%GMTIME{"$epoch"}%" type="application/x-wiki" title="edit %BASETOPIC%" />
<meta name="TEXT_NUM_TOPICS" content="%MAKETEXT{"Number of topics:"}%" />
<meta name="TEXT_MODIFY_SEARCH" content="%MAKETEXT{"Modify search"}%" />
<meta name="robots" content="noindex" />%HTTP_EQUIV_ON_VIEW%
<base href="%SCRIPTURL{"view"}%/" /><!--[if IE]></base><![endif]-->%TMPL:END%

0 comments on commit b2f2bc2

Please sign in to comment.