this.bindings(method, options);
- $('[data-topbar]', this.scope).each(function () {
+ self.S('[' + this.attr_name() + ']', this.scope).each(function () {
- var topbar = self.S(this),
+ var topbar = $(this),
- settings = topbar.data('topbar-init'),
- section = $('section', this),
+ settings = topbar.data(self.attr_name(true) + '-init'),
+ section = self.S('section', this),
- titlebar = $('> ul', this).first();
+ titlebar = topbar.children().filter('ul').first();
topbar.data('index', 0);
e.preventDefault();
self.toggle(this);
})
- .on('click.fndtn.topbar','.top-bar .top-bar-section li a[href^="#"],[data-topbar] .top-bar-section li a[href^="#"]',function (e) {
- .on('click.fndtn.topbar', '[data-topbar] li.has-dropdown', function (e) {
- var li = $(this),
- target = $(e.target),
- topbar = li.closest('[data-topbar]'),
- settings = topbar.data('topbar-init');
++ .on('click.fndtn.topbar','.top-bar .top-bar-section li a[href^="#"],[' + this.attr_name() + '] .top-bar-section li a[href^="#"]',function (e) {
+ var li = $(this).closest('li');
+ if(self.breakpoint() && !li.hasClass('back') && !li.hasClass('has-dropdown'))
+ {
+ self.toggle();
+ }
+ })
+ .on('click.fndtn.topbar', '[' + this.attr_name() + '] li.has-dropdown', function (e) {
+ var li = S(this),
+ target = S(e.target),
+ topbar = li.closest('[' + self.attr_name() + ']'),
+ settings = topbar.data(self.attr_name(true) + '-init');
if(target.data('revealId')) {
self.toggle();
assemble : function (topbar) {
var self = this,
- settings = topbar.data('topbar-init'),
- section = $('section', topbar),
+ settings = topbar.data(this.attr_name(true) + '-init'),
+ section = self.S('section', topbar),
- titlebar = $('> ul', topbar).first();
+ titlebar = $(this).children().filter('ul').first();
// Pull element out of the DOM for manipulation
section.detach();