Browse Source

Fixes #1513, calls to $.tab were not correctly passing behavior arguments

pull/1550/head
jlukic 10 years ago
parent
commit
46ff0e5b75
1 changed files with 26 additions and 37 deletions
  1. 63
      src/definitions/modules/tab.js

63
src/definitions/modules/tab.js

@ -13,7 +13,7 @@
"use strict";
$.tab = $.fn.tab = function(parameters) {
$.fn.tab = function(parameters) {
var
// use window context if none specified
@ -37,6 +37,8 @@ $.tab = $.fn.tab = function(parameters) {
returnedValue
;
console.log(arguments);
$allModules
.each(function() {
@ -158,6 +160,7 @@ $.tab = $.fn.tab = function(parameters) {
instantiate: function () {
module.verbose('Storing instance of module', module);
instance = module;
$module
.data(moduleNamespace, module)
;
@ -313,7 +316,7 @@ $.tab = $.fn.tab = function(parameters) {
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
}
else if(tabPath.search('/') == -1) {
else if(tabPath.search('/') == -1 && tabPath !== '') {
// look for in page anchor
$anchor = $('#' + tabPath + ', a[name="' + tabPath + '"]'),
currentPath = $anchor.closest('[data-tab]').data('tab');
@ -697,7 +700,6 @@ $.tab = $.fn.tab = function(parameters) {
return found;
}
};
if(methodInvoked) {
if(instance === undefined) {
module.initialize();
@ -723,51 +725,38 @@ $.tab = $.fn.tab = function(parameters) {
};
// shortcut for tabbed content with no defined navigation
$.tab = function(settings) {
$(window).tab(settings);
$.tab = function() {
$(window).tab.apply(this, arguments);
};
$.fn.tab.settings = {
name : 'Tab',
namespace : 'tab',
debug : false,
verbose : true,
performance : true,
// uses pjax style endpoints fetching content from same url with remote-content headers
auto : false,
history : false,
historyType : 'hash',
path : false,
context : false,
childrenOnly : false,
// max depth a tab can be nested
maxDepth : 25,
// dont load content on first load
ignoreFirstLoad : false,
name : 'Tab',
namespace : 'tab',
// load tab content new every tab click
alwaysRefresh : false,
debug : false,
verbose : true,
performance : true,
// cache the content requests to pull locally
cache : true,
auto : false, // uses pjax style endpoints fetching content from same url with remote-content headers
history : false, // use browser history
historyType : 'hash', // #/ or html5 state
path : false, // base path of url
// settings for api call
apiSettings : false,
context : false, // specify a context that tabs must appear inside
childrenOnly : false, // use only tabs that are children of context
maxDepth : 25, // max depth a tab can be nested
// only called first time a tab's content is loaded (when remote source)
onTabInit : function(tabPath, parameterArray, historyEvent) {},
alwaysRefresh : false, // load tab content new every tab click
cache : true, // cache the content requests to pull locally
ignoreFirstLoad : false, // don't load remote content on first load
apiSettings : false, // settings for api call
// called on every load
onTabLoad : function(tabPath, parameterArray, historyEvent) {},
onTabInit : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
onTabLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
templates : {
determineTitle: function(tabArray) {}
determineTitle: function(tabArray) {} // returns page title for path
},
error: {

Loading…
Cancel
Save