js/foundation/foundation.topbar.js in zurb-foundation-4.0.4 vs js/foundation/foundation.topbar.js in zurb-foundation-4.0.5
- old
+ new
@@ -9,11 +9,12 @@
version : '4.0.0',
settings : {
index : 0,
stickyClass : 'sticky',
- back_text: '« Back',
+ custom_back_text: true,
+ back_text: 'Back',
init : false
},
init : function (scope, method, options) {
var self = this;
@@ -148,11 +149,17 @@
this.settings.$section.detach();
this.settings.$section.find('.has-dropdown>a').each(function () {
var $link = $(this),
$dropdown = $link.siblings('.dropdown'),
- $titleLi = $('<li class="title back js-generated"><h5><a href="#">' + self.settings.back_text + '</a></h5></li>');
+ $titleLi = $('<li class="title back js-generated"><h5><a href="#"></a></h5></li>');
+
// Copy link to subnav
+ if (self.settings.custom_back_text == true) {
+ $titleLi.find('h5>a').html('« ' + self.settings.back_text);
+ } else {
+ $titleLi.find('h5>a').html('« ' + $link.html());
+ }
$dropdown.prepend($titleLi);
});
// Put element back in the DOM
this.settings.$section.appendTo(this.settings.$topbar);