zurb-foundation 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (92) hide show
  1. data/CHANGELOG.md +11 -0
  2. data/Gemfile.lock +1 -1
  3. data/README.md +5 -0
  4. data/docs/Gemfile +2 -1
  5. data/docs/Gemfile.lock +1 -1
  6. data/docs/_sidebar-components.html.erb +40 -40
  7. data/docs/_sidebar.html.erb +9 -9
  8. data/docs/changelog.html.erb +30 -6
  9. data/docs/components/alert-boxes.html.erb +1 -1
  10. data/docs/components/block-grid.html.erb +10 -10
  11. data/docs/components/breadcrumbs.html.erb +1 -1
  12. data/docs/components/button-groups.html.erb +57 -3
  13. data/docs/components/buttons.html.erb +1 -1
  14. data/docs/components/clearing.html.erb +12 -14
  15. data/docs/components/custom-forms.html.erb +3 -3
  16. data/docs/components/dropdown-buttons.html.erb +1 -1
  17. data/docs/components/dropdown.html.erb +2 -2
  18. data/docs/components/flex-video.html.erb +1 -1
  19. data/docs/components/forms.html.erb +4 -3
  20. data/docs/components/grid.html.erb +2 -2
  21. data/docs/components/inline-lists.html.erb +1 -1
  22. data/docs/components/keystrokes.html.erb +1 -1
  23. data/docs/components/labels.html.erb +1 -1
  24. data/docs/components/orbit.html.erb +11 -11
  25. data/docs/components/pagination.html.erb +1 -1
  26. data/docs/components/panels.html.erb +1 -1
  27. data/docs/components/pricing-tables.html.erb +1 -1
  28. data/docs/components/progress-bars.html.erb +1 -1
  29. data/docs/components/reveal.html.erb +8 -0
  30. data/docs/components/section.html.erb +29 -3
  31. data/docs/components/side-nav.html.erb +1 -1
  32. data/docs/components/split-buttons.html.erb +1 -1
  33. data/docs/components/sub-nav.html.erb +1 -1
  34. data/docs/components/switch.html.erb +1 -1
  35. data/docs/components/thumbnails.html.erb +5 -5
  36. data/docs/components/top-bar.html.erb +65 -2
  37. data/docs/components/type.html.erb +1 -1
  38. data/docs/css/docs.scss +2 -0
  39. data/docs/faq.html.erb +2 -0
  40. data/docs/img/demos/demo1-th.jpg +0 -0
  41. data/docs/img/demos/demo1.jpg +0 -0
  42. data/docs/img/demos/demo2-th.jpg +0 -0
  43. data/docs/img/demos/demo2.jpg +0 -0
  44. data/docs/img/demos/demo3-th.jpg +0 -0
  45. data/docs/img/demos/demo3.jpg +0 -0
  46. data/docs/img/demos/demo4-th.jpg +0 -0
  47. data/docs/img/demos/demo4.jpg +0 -0
  48. data/docs/img/demos/demo5-th.jpg +0 -0
  49. data/docs/img/demos/demo5.jpg +0 -0
  50. data/docs/index.html.erb +1 -1
  51. data/docs/javascript.html.erb +2 -2
  52. data/docs/layout.html.erb +18 -2
  53. data/docs/rails.html.erb +10 -2
  54. data/docs/sass.html.erb +49 -19
  55. data/docs/support.html.erb +1 -1
  56. data/js/foundation/foundation.forms.js +1 -1
  57. data/js/foundation/foundation.js +1 -1
  58. data/js/foundation/foundation.reveal.js +9 -3
  59. data/js/foundation/foundation.topbar.js +7 -5
  60. data/lib/foundation/engine.rb +12 -4
  61. data/lib/foundation/version.rb +1 -1
  62. data/scss/foundation.scss +1 -2
  63. data/scss/foundation/_foundation-global.scss +25 -74
  64. data/scss/foundation/components/_block-grid.scss +2 -2
  65. data/scss/foundation/components/_button-groups.scss +17 -2
  66. data/scss/foundation/components/_buttons.scss +2 -2
  67. data/scss/foundation/components/_custom-forms.scss +10 -7
  68. data/scss/foundation/components/_forms.scss +28 -0
  69. data/scss/foundation/components/_global.scss +62 -0
  70. data/scss/foundation/components/_orbit.scss +1 -1
  71. data/scss/foundation/components/_section.scss +4 -4
  72. data/scss/foundation/components/_switch.scss +17 -9
  73. data/scss/foundation/components/_tooltips.scss +1 -2
  74. data/scss/foundation/components/_top-bar.scss +11 -2
  75. data/scss/foundation/components/_type.scss +3 -2
  76. data/scss/foundation/components/_visibility.scss +2 -2
  77. data/templates/project/config.rb +4 -4
  78. data/templates/project/index.html +9 -9
  79. data/templates/project/manifest.rb +8 -8
  80. data/templates/project/scss/_settings.scss +11 -10
  81. data/templates/project/scss/app.scss +1 -0
  82. metadata +15 -14
  83. data/docs/img/demos/demo1-th.png +0 -0
  84. data/docs/img/demos/demo1.png +0 -0
  85. data/docs/img/demos/demo2-th.png +0 -0
  86. data/docs/img/demos/demo2.png +0 -0
  87. data/docs/img/demos/demo3-th.png +0 -0
  88. data/docs/img/demos/demo3.png +0 -0
  89. data/docs/img/demos/demo4-th.png +0 -0
  90. data/docs/img/demos/demo4.png +0 -0
  91. data/docs/img/demos/demo5-th.png +0 -0
  92. data/docs/img/demos/demo5.png +0 -0
@@ -8,6 +8,68 @@
8
8
  <div class="large-12 columns">
9
9
  <h1><%= @page_title %></h1>
10
10
  <h4 class="subheader">The Foundation Top Bar gives you a great way to display a complex navigation bar on small or large screens.</h4>
11
+
12
+ <nav class="top-bar">
13
+ <ul class="title-area">
14
+ <!-- Title Area -->
15
+ <li class="name">
16
+ <h1><a href="/">Top Bar</a></h1>
17
+ </li>
18
+ <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
19
+ <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
20
+ </ul>
21
+
22
+ <section class="top-bar-section">
23
+ <ul class="left">
24
+ <li class="divider"></li>
25
+ <li class="has-dropdown"><a href="<%= features_path %>">Item 1</a>
26
+
27
+ <ul class="dropdown">
28
+ <li><label>Level One</label></li>
29
+ <li><a href="#">Sub-item 1</a></li>
30
+ <li><a href="#">Sub-item 2</a></li>
31
+ <li class="divider"></li>
32
+ <li><a href="#">Sub-item 3</a></li>
33
+ <li class="has-dropdown"><a href="#">Sub-item 4</a>
34
+
35
+ <ul class="dropdown">
36
+ <li><label>Level Two</label></li>
37
+ <li class="has-dropdown"><a href="#">Sub-item 1</a>
38
+
39
+ <ul class="dropdown">
40
+ <li><label>Level Three</label></li>
41
+ <li class="has-dropdown"><a href="#">Sub-item 1</a>
42
+
43
+ <ul class="dropdown">
44
+ <li><label>Level Four</label></li>
45
+ <li><a href="#">Sub-item 1</a></li>
46
+ </ul>
47
+ </li>
48
+ <li><a href="#">Sub-item 2</a></li>
49
+ <li><a href="#">Sub-item 3</a></li>
50
+ <li class="divider"></li>
51
+ <li><a href="#">Sub-item 4</a></li>
52
+ </ul>
53
+ </li>
54
+ <li><a href="#">Sub-item 2</a></li>
55
+ <li><a href="#">Sub-item 3</a></li>
56
+ <li><a href="#">Sub-item 4</a>
57
+ </ul>
58
+ </li>
59
+ <li><a href="#">Sub-item 5</a></li>
60
+ </ul>
61
+ </li>
62
+ <li class="divider"></li>
63
+ </ul>
64
+ <!-- Right Nav Section -->
65
+ <ul class="right">
66
+ <li class="divider"></li>
67
+ <li><a href="#">Item 2</a></li>
68
+ </ul>
69
+ </section>
70
+ </nav>
71
+
72
+ <hr>
11
73
  </div>
12
74
  </div>
13
75
 
@@ -30,7 +92,7 @@
30
92
  <p>When building your bar it is good to be aware of how many links your're going to need in it so you can customize your responsive breakpoint accordingly. Build your navigation with <code>ul.left</code> and/or <code>ul.right</code> depending where you want links. To add items, simply include <code>li</code> elements with and anchor inside them for your top-level. To build a dropdown menu, you'll need to add <code>has-dropdown</code> to the <code>li</code> and include <code>ul.dropdown</code> after that anchor. Add a class of <code>active</code> to mark the current page.</p>
31
93
 
32
94
  <h5>Other Elements</h5>
33
- <p>To make this navigation nice and flexible, we've included patterns for elements like buttons, inputs and dividers. To create dividers between your navigation, just add an empty <code>li.divider</code> and you'll get some separation. You can use a small Foundation button in the nav, just include <code>has-button</code> as a class for its parent li. You can include two different input types: search and text. To use these, add a class of search to the parent li.</p>
95
+ <p>To make this navigation nice and flexible, we've included patterns for elements like buttons, inputs and dividers. To create dividers between your navigation, just add an empty <code>li.divider</code> and you'll get some separation. You can use a small Foundation button in the nav, just include <code>has-form</code> as a class for its parent li. You can include two different input types: search and text. To use these, add a class of search to the parent li.</p>
34
96
 
35
97
  <h5>Sticky Top Bar</h5>
36
98
  <p>You may also wrap your top bar in <code>div class="contain-to-grid sticky"</code> and put it anywhere within your markup. When the navigation hits the top of the browser, it will act like the fixed top bar and stick to the top as users continue to scroll.</p>
@@ -177,6 +239,7 @@ $topbar-dropdown-link-color: #fff;
177
239
  $topbar-dropdown-toggle-size: 5px;
178
240
  $topbar-dropdown-toggle-color: #fff;
179
241
  $topbar-dropdown-toggle-alpha: 0.5;
242
+ $dropdown-label-color: #555;
180
243
 
181
244
  /* Top menu icon styles */
182
245
  $topbar-menu-link-transform: uppercase;
@@ -196,7 +259,7 @@ $topbar-breakpoint: emCalc(940px); // Change to 9999px for always mobile layout'
196
259
  <hr>
197
260
 
198
261
  <h3>Using the JavaScript</h3>
199
- <p>You don't need ths JS to create reveal modals with Foundation. The only reason you'll need to include <code>foundation.reveal.js</code> is if you want to add the ability to close an alert. You'll also need to make sure to include <code>zepto.js</code> and <code>foundation.js</code> above the alert plugin. Above your closing <code>&lt;/body&gt;</code> tag include the following line of code and make sure you have the JS in your directory.</p>
262
+ <p>You'll need to include <code>foundation.topbar.js</code> to get the topbar to play nice. You'll also need to make sure to include <code>zepto.js</code> and <code>foundation.js</code> above the topbar plugin. Above your closing <code>&lt;/body&gt;</code> tag include the following line of code and make sure you have the JS in your directory.</p>
200
263
 
201
264
  <p><a href="../javascript.html" title="How to install Foundation JavaScript">Read how to install Foundation JavaScript</a></p>
202
265
 
@@ -246,7 +246,7 @@
246
246
  <li>Page cleanup and window minimization</li>
247
247
  </ul>
248
248
 
249
- <p>On top of that, Foundation includes a couple of simple classes you can use to control elements printing, or not printing. Simply attached <code>.print-only</code> on an element to only show when printing, and <code>.hide-on-print</code> to hide something when printing.</p>
249
+ <p>On top of that, Foundation includes a couple of simple classes you can use to control elements printing, or not printing. Simply attach <code>.print-only</code> to an element to only show when printing, and <code>.hide-on-print</code> to hide something when printing.</p>
250
250
 
251
251
  <hr>
252
252
 
data/docs/css/docs.scss CHANGED
@@ -50,6 +50,8 @@ footer.row.full-width {
50
50
  float: left;
51
51
  }
52
52
 
53
+ .docs.section-container a.active { font-weight: bold; }
54
+
53
55
 
54
56
  /* Alert Docs */
55
57
  .alert-base {
data/docs/faq.html.erb CHANGED
@@ -1,3 +1,5 @@
1
+ <% @page_title = "faq" %>
2
+
1
3
  <div class="row">
2
4
 
3
5
  <div class="large-9 push-3 columns">
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
data/docs/index.html.erb CHANGED
@@ -1,5 +1,5 @@
1
1
  <% @side_nav = "using" %>
2
-
2
+ <% @page_title = "Getting Started" %>
3
3
  <div class="row">
4
4
  <div class="large-9 push-3 columns">
5
5
 
@@ -16,7 +16,7 @@
16
16
  <p>In the <code>head</code> section of your page add Modernizr. Modernizr acts as a shim for HTML5 elements for older browsers as well as detection for mobile devices.</p>
17
17
 
18
18
  <%= code_example '
19
- <script src="/js/custom.modernizr.js></script>
19
+ <script src="/js/custom.modernizr.js"></script>
20
20
  ', :html %>
21
21
 
22
22
  <p>Before the closing <code>body</code> tag, insert the following JavaScript.</p>
@@ -30,7 +30,7 @@
30
30
  </script>
31
31
  ", :html %>
32
32
 
33
- <p>Then include either <code>foundation.min.js</code>, which includes Foundation Core and all JavaScript plugins or you can load them invidually.</p>
33
+ <p>Then include either <code>foundation.min.js</code>, which includes Foundation Core and all JavaScript plugins or you can load them invidually. The minified version is not available in the Compass version.</p>
34
34
 
35
35
  <%= code_example '
36
36
  <script src="/js/foundation.min.js"></script>
data/docs/layout.html.erb CHANGED
@@ -77,8 +77,8 @@
77
77
  <ul class="inline-list right">
78
78
  <li><a href="http://foundation.zurb.com">Home</a></li>
79
79
  <li><a href="http://foundation.zurb.com/download.php">Download</a></li>
80
- <li><a href="index.html">Docs</a></li>
81
- <li><a href="changelog.html">Changelog</a></li>
80
+ <li><a href="http://foundation.zurb.com/docs">Docs</a></li>
81
+ <li><a href="http://foundation.zurb.com/docs/changelog.html">Changelog</a></li>
82
82
  <li><a href="http://foundation.zurb.com/about.php">About</a></li>
83
83
  <li><a href="http://feeds.feedburner.com/zurb/blog">Subscribe to the ZURBlog</a></li>
84
84
  </ul>
@@ -87,6 +87,22 @@
87
87
  </div>
88
88
 
89
89
  <script>
90
+
91
+ // Google Analytics
92
+ var _gaq = _gaq || [];
93
+ _gaq.push(
94
+ ['_setAccount', 'UA-2195009-2'],
95
+ ['_trackPageview'],
96
+ ['b._setAccount', 'UA-2195009-27'],
97
+ ['b._trackPageview']
98
+ );
99
+
100
+ (function() {
101
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
102
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
103
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
104
+ })();
105
+
90
106
  document.write('<script src="<%= asset_path %>/vendor/'
91
107
  + ('__proto__' in {} ? 'zepto' : 'jquery')
92
108
  + '.js"><\/script>');
data/docs/rails.html.erb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <div class="row">
4
4
  <div class="large-9 push-3 columns"
5
- <% @page_title = "Installing with Rails" %>
5
+ <% @page_title = "Rails" %>
6
6
  <div class="row">
7
7
  <div class="large-12 columns">
8
8
  <h2><%= @page_title %></h2>
@@ -46,12 +46,20 @@ end
46
46
  ', :css %>
47
47
 
48
48
  <h5 class="subheader">Add Foundation to your JS</h5>
49
- <p>Append the following line to your <code>app/assets/javascripts/application.js</code> file:</p>
49
+ <p>Append the following lines to your <code>app/assets/javascripts/application.js</code> file:</p>
50
50
 
51
51
  <%= code_example '
52
52
  //= require foundation
53
+ $(document).foundation();
53
54
  ', :js %>
54
55
 
56
+ <h5 class="subheader">Add Modernizr</h5>
57
+ <p>Make sure that <a href="http://modernizr.com/" rel="nofollow">Modernizr</a> is included in the <code>&lt;head&gt;</code> of your page:</p>
58
+
59
+ <%= code_example '
60
+ javascript_include_tag "vendor/custom.modernizr"
61
+ ', :ruby %>
62
+
55
63
  <h5 class="subheader">Set Viewport Width</h5>
56
64
  <p>Add the following line to the <kbd>&lt;head&gt;</kbd> of your page layout:</p>
57
65
 
data/docs/sass.html.erb CHANGED
@@ -1,5 +1,5 @@
1
1
  <% @side_nav = "using" %>
2
-
2
+ <% @page_title = "Sass" %>
3
3
  <div class="row">
4
4
  <div class="large-9 push-3 columns">
5
5
 
@@ -27,16 +27,6 @@
27
27
  </div>
28
28
  </div>
29
29
 
30
- <br>
31
-
32
- <div class="row">
33
- <div class="large-12 columns">
34
- <h5>Compiling Your Scss</h5>
35
- <p>To compile your Scss into CSS you run a simple command that will watch for saves and compile each time you save an Scss file. The command is:</p>
36
- <p class="btm-marg keystroke">compass watch</p>
37
- </div>
38
- </div>
39
-
40
30
  <br>
41
31
  <hr>
42
32
 
@@ -49,6 +39,19 @@
49
39
  <li>run <span class="keystroke">compass create &lt;project-name&gt; -r zurb-foundation --using foundation</span></li>
50
40
  </ol>
51
41
 
42
+ <br>
43
+
44
+ <div class="row">
45
+ <div class="large-12 columns">
46
+ <h5>Compiling Your Scss</h5>
47
+ <p>To compile your Scss into CSS you run a simple command that will watch for saves and compile each time you save an Scss file. From the directory of your <kbd>config.rb</kbd> file, the command is:</p>
48
+ <p class="btm-marg keystroke">compass watch</p>
49
+ <p>If you are in a different directory you can use the same command, but navigate to where your <kbd>config.rb</kbd> file is. The command looks like:</p>
50
+ <p class="btm-marg keystroke">compass watch path/to/project</p>
51
+ </div>
52
+ </div>
53
+
54
+
52
55
  <hr>
53
56
 
54
57
  <a name="compass-existing"></a>
@@ -86,15 +89,42 @@
86
89
 
87
90
  <p>There are a few different ways to do this, but here's what we recommend:</p>
88
91
  <ol style="margin-left: 20px;">
89
- <li>Setup a Foundation project folder: <kbd>mkdir ~/awesomeapp</kbd></li>
90
- <li>Create a Gemfile with this content: <br>
91
- <kbd style="margin-left: 15px;">source :rubygems</kbd> <br>
92
- <kbd style="margin-left: 15px;">gem "zurb-foundation", :git => "git@github.com:zurb/foundation.git"</kbd> <br>
93
- <kbd style="margin-left: 15px;">gem "compass"</kbd>
92
+ <li>Setup a folder for your project (i.e. <kbd>mkdir ~/awesomeapp</kbd>)
93
+ <li>Create a file called <code>Gemfile</code> in the folder you just created with this content: <br>
94
+ <%= code_example '
95
+ source "https://rubygems.org"
96
+ gem "zurb-foundation", :git => "git@github.com:zurb/foundation.git"
97
+ gem "compass"
98
+ ', :ruby %>
99
+ </li>
100
+ <li>Change into your application directory (<kbd>cd ~/awesomeapp</kbd>) then create a new compass project using the following command:</li>
101
+ <%= code_example '
102
+ bundle exec compass create . -r zurb-foundation --using foundation
103
+ ', :bash %>
104
+ <li>When you're working on your project, run: <kbd>bundle exec compass watch</kbd></li>
105
+ </ol>
106
+
107
+ <hr>
108
+
109
+ <a name="multiple-versions"></a>
110
+ <h3>Running multiple versions</h3>
111
+ <h5 class="subheader">If you're planning on running multiple, potentially incompatible versions of Foundation you can isolate them using Bundler as well.</h5>
112
+
113
+ <p>There are a few different ways to do this, but here's what we recommend:</p>
114
+ <ol style="margin-left: 20px;">
115
+ <li>Setup a folder for your project (i.e. <kbd>mkdir ~/awesomeapp</kbd>)
116
+ <li>Create a file called <code>Gemfile</code> in the folder you just created with this content: <br>
117
+ <%= code_example '
118
+ source "https://rubygems.org"
119
+ # Replace 4.0.3 with the version of Foundation you want to use
120
+ gem "zurb-foundation", "4.0.3"
121
+ gem "compass"
122
+ ', :ruby %>
94
123
  </li>
95
- <li>Then run: <kbd>touch ~/awesomeapp/Gemfile</kbd></li>
96
- <li>Change into your application directory: <kbd>cd ~/awesomeapp</kbd></li>
97
- <li>Create a project using Bundler: <kbd>bundle exec compass create . -r zurb-foundation --using foundation</kbd></li>
124
+ <li>Change into your application directory (<kbd>cd ~/awesomeapp</kbd>) then create a new compass project using the following command:</li>
125
+ <%= code_example '
126
+ bundle exec compass create . -r zurb-foundation --using foundation
127
+ ', :bash %>
98
128
  <li>When you're working on your project, run: <kbd>bundle exec compass watch</kbd></li>
99
129
  </ol>
100
130
 
@@ -68,7 +68,7 @@
68
68
  <div class="row support">
69
69
  <div class="small-3 columns">IE7</div>
70
70
  <div class="small-3 columns"><span class="fail">&#x2717;</span></div>
71
- <div class="small-3 columns"><span data-tooltip title="While we don't officially IE7, but our UI styles should work for the most part" class="meh has-tip tip-top" data-width="200">&#9679;</span></div>
71
+ <div class="small-3 columns"><span data-tooltip title="While we don't officially support IE7, but our UI styles should work for the most part" class="meh has-tip tip-top" data-width="200">&#9679;</span></div>
72
72
  <div class="small-3 columns"><span data-tooltip title="While we don't officially IE7, but our JS works for the most part. Clearing and tooltips have some issues with style and position." class="meh has-tip tip-top" data-width="200">&#9679;</span></div>
73
73
  </div>
74
74
 
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.forms = {
7
7
  name : 'forms',
8
8
 
9
- version : '4.0.0',
9
+ version : '4.0.4',
10
10
 
11
11
  settings : {
12
12
  disable_class: 'no-custom'
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Foundation Responsive Library 4.0.0
2
+ * Foundation Responsive Library
3
3
  * http://foundation.zurb.com
4
4
  * Copyright 2013, ZURB
5
5
  * Free to use under the MIT license.
@@ -6,7 +6,7 @@
6
6
  Foundation.libs.reveal = {
7
7
  name: 'reveal',
8
8
 
9
- version : '4.0.3',
9
+ version : '4.0.4',
10
10
 
11
11
  locked : false,
12
12
 
@@ -78,8 +78,13 @@
78
78
  },
79
79
 
80
80
  open : function (target) {
81
- var modal = $('#' + target.data('reveal-id')),
82
- open_modal = $('.reveal-modal.open');
81
+ if (target) {
82
+ var modal = $('#' + target.data('reveal-id'));
83
+ } else {
84
+ var modal = $(this.scope);
85
+ }
86
+
87
+ var open_modal = $('.reveal-modal.open');
83
88
 
84
89
  if (!modal.data('css-top')) {
85
90
  modal.data('css-top', parseInt(modal.css('top'), 10))
@@ -96,6 +101,7 @@
96
101
  },
97
102
 
98
103
  close : function (modal) {
104
+ var modal = modal || $(this.scope);
99
105
  this.locked = true;
100
106
  var open_modal = $('.reveal-modal.open').not(modal);
101
107
  modal.trigger('close');
@@ -6,11 +6,12 @@
6
6
  Foundation.libs.topbar = {
7
7
  name : 'topbar',
8
8
 
9
- version : '4.0.2',
9
+ version : '4.0.0',
10
10
 
11
11
  settings : {
12
12
  index : 0,
13
13
  stickyClass : 'sticky',
14
+ back_text: '&laquo; Back',
14
15
  init : false
15
16
  },
16
17
 
@@ -39,10 +40,8 @@
39
40
 
40
41
  self.assemble();
41
42
 
42
- if (!self.settings.$topbar.data('height')) self.largestUL();
43
-
44
43
  if (self.settings.$topbar.parent().hasClass('fixed')) {
45
- $('body').css('padding-top', this.outerHeight(this.settings.$topbar));
44
+ $('body').css('padding-top', self.outerHeight(self.settings.$topbar));
46
45
  }
47
46
  });
48
47
 
@@ -66,6 +65,8 @@
66
65
  section = topbar.find('section, .section'),
67
66
  titlebar = topbar.children('ul').first();
68
67
 
68
+ if (!self.settings.$topbar.data('height')) self.largestUL();
69
+
69
70
  e.preventDefault();
70
71
 
71
72
  if (self.breakpoint()) {
@@ -142,13 +143,14 @@
142
143
  },
143
144
 
144
145
  assemble : function () {
146
+ var self = this;
145
147
  // Pull element out of the DOM for manipulation
146
148
  this.settings.$section.detach();
147
149
 
148
150
  this.settings.$section.find('.has-dropdown>a').each(function () {
149
151
  var $link = $(this),
150
152
  $dropdown = $link.siblings('.dropdown'),
151
- $titleLi = $('<li class="title back js-generated"><h5><a href="#">&laquo; Back</a></h5></li>');
153
+ $titleLi = $('<li class="title back js-generated"><h5><a href="#">' + self.settings.back_text + '</a></h5></li>');
152
154
  // Copy link to subnav
153
155
  $dropdown.prepend($titleLi);
154
156
  });
@@ -1,12 +1,20 @@
1
1
  module Foundation
2
2
  class Engine < Rails::Engine
3
- # auto wire assets
4
- initializer 'foundation.update_asset_paths' do |app|
3
+ # Save this block, we'll use it in two calls to .initializer
4
+ add_paths_block = lambda { |app|
5
5
  app.config.assets.paths << File.expand_path("../../../scss", __FILE__)
6
6
  app.config.assets.paths << File.expand_path("../../../js", __FILE__)
7
7
 
8
8
  # Ensure Zepto and Modernizr are precompiled in production
9
9
  app.config.assets.precompile += %w(vendor/zepto.js vendor/custom.modernizr.js)
10
- end
10
+ }
11
+
12
+ # Standard initializer
13
+ initializer 'foundation.update_asset_paths', &add_paths_block
14
+
15
+ # Special initializer lets us precompile assets without fully initializing
16
+ initializer 'foundation.update_asset_paths', :group => :assets,
17
+ &add_paths_block
18
+
11
19
  end
12
- end
20
+ end