aboutsummaryrefslogtreecommitdiffstats
path: root/docs/src/templates/docs.js
diff options
context:
space:
mode:
authorVojta Jina2011-05-24 00:49:33 +0200
committerIgor Minar2011-06-06 22:52:01 -0700
commit2da07127e45312ce22d894aa771b8797e9a301a1 (patch)
treecc588b8fbdb5792c908b2b216bc9b9ab12c84663 /docs/src/templates/docs.js
parentd05e83992023c0aa8c663ac187529abf45dfe533 (diff)
downloadangular.js-2da07127e45312ce22d894aa771b8797e9a301a1.tar.bz2
Add doc:tutorial-instructions widget
Diffstat (limited to 'docs/src/templates/docs.js')
-rw-r--r--docs/src/templates/docs.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js
index e05f0ec1..47d294c3 100644
--- a/docs/src/templates/docs.js
+++ b/docs/src/templates/docs.js
@@ -65,3 +65,21 @@ angular.widget('code', function(element){
SyntaxHighlighter['defaults'].toolbar = false;
SyntaxHighlighter['defaults'].gutter = false;
+
+/**
+ * Controller for tutorial instructions
+ * @param $cookieStore
+ * @constructor
+ */
+function TutorialInstructionsCtrl($cookieStore) {
+ this.selected = $cookieStore.get('selEnv') || 'git-mac';
+
+ this.currentCls = function(id, cls) {
+ return this.selected == id ? cls || 'current' : '';
+ };
+
+ this.select = function(id) {
+ this.selected = id;
+ $cookieStore.put('selEnv', id);
+ };
+}