Browse Source

Remove proxy calls from tab and visit

pull/1615/head
jlukic 10 years ago
parent
commit
87a11d6772
2 changed files with 10 additions and 10 deletions
  1. 4
      src/definitions/behaviors/visit.js
  2. 16
      src/definitions/modules/tab.js

4
src/definitions/behaviors/visit.js

@ -233,10 +233,10 @@ $.visit = $.fn.visit = function(parameters) {
if(settings.limit) { if(settings.limit) {
if(value >= settings.limit) { if(value >= settings.limit) {
module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit); module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit);
$.proxy(settings.onLimit, element)(value);
settings.onLimit.call(element, value);
} }
module.debug('Limit not reached', value, settings.limit); module.debug('Limit not reached', value, settings.limit);
$.proxy(settings.onChange, element)(value);
settings.onChange.call(element, value);
} }
module.update.display(value); module.update.display(value);
} }

16
src/definitions/modules/tab.js

@ -297,8 +297,8 @@ $.fn.tab = function(parameters) {
firstLoad = false; firstLoad = false;
module.cache.add(tabPath, $tab.html()); module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath); module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
settings.onTabLoad.call($tab, currentPath, parameterArray, historyEvent);
} }
return false; return false;
} }
@ -308,9 +308,9 @@ $.fn.tab = function(parameters) {
if( !module.cache.read(currentPath) ) { if( !module.cache.read(currentPath) ) {
module.cache.add(currentPath, true); module.cache.add(currentPath, true);
module.debug('First time tab loaded calling tab init'); module.debug('First time tab loaded calling tab init');
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
} }
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
settings.onTabLoad.call($tab, currentPath, parameterArray, historyEvent);
} }
} }
else if(tabPath.search('/') == -1 && tabPath !== '') { else if(tabPath.search('/') == -1 && tabPath !== '') {
@ -325,7 +325,7 @@ $.fn.tab = function(parameters) {
if( !module.cache.read(currentPath) ) { if( !module.cache.read(currentPath) ) {
module.cache.add(currentPath, true); module.cache.add(currentPath, true);
module.debug('First time tab loaded calling tab init'); module.debug('First time tab loaded calling tab init');
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
settings.onTabInit.call($tab, currentPath, parameterArray, historyEvent);
} }
return false; return false;
} }
@ -355,8 +355,8 @@ $.fn.tab = function(parameters) {
else { else {
module.debug('Content loaded in background', tabPath); module.debug('Content loaded in background', tabPath);
} }
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
settings.onTabInit.call($tab, tabPath, parameterArray, historyEvent);
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
}, },
urlData: { tab: fullTabPath } urlData: { tab: fullTabPath }
}, },
@ -373,7 +373,7 @@ $.fn.tab = function(parameters) {
module.debug('Showing existing content', fullTabPath); module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent); module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath); module.activate.tab(tabPath);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
settings.onTabLoad.call($tab, tabPath, parameterArray, historyEvent);
} }
else if(existingRequest) { else if(existingRequest) {
module.debug('Content is already loading', fullTabPath); module.debug('Content is already loading', fullTabPath);

Loading…
Cancel
Save