]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Merge conflicts.
authorJordan Humphreys <jordan@mailyard.net>
Thu, 27 Feb 2014 23:26:32 +0000 (15:26 -0800)
committerJordan Humphreys <jordan@mailyard.net>
Thu, 27 Feb 2014 23:26:32 +0000 (15:26 -0800)
1  2 
js/foundation/foundation.topbar.js

index 2c88a562b13624501a3dcf0bd2960acfe977bc94,f972dccdf0ed97602cbc31a0ef1b2b2f402551cc..5dda36116f6c50ec707649fd13b0c7163bbac508
  
        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();