Browse Source

Updates tab module

Former-commit-id: 0dc64c8a0c7df5621af0ce560a79aafcf4145e9b
Former-commit-id: 08e58b90ba32c9096f8dc30c07dcfb6837c787a0
beta
Jack Lukic 11 years ago
parent
commit
5ee24561bb
  1. 35
      build/minified/modules/tab.js
  2. 2
      build/minified/modules/tab.min.js
  3. 35
      build/packaged/modules/tab.js
  4. 2
      build/packaged/semantic.min.js.REMOVED.git-id
  5. 35
      build/uncompressed/modules/tab.js
  6. 35
      node/src/files/components/semantic/modules/tab.js
  7. 4
      node/src/files/stylesheets/semantic.css
  8. 35
      src/modules/tab.js

35
build/minified/modules/tab.js

@ -62,7 +62,7 @@
return false;
}
else {
if(!settings.apiSettings) {
if($.isPlainObject(settings.apiSettings) && settings.action === undefined && settings.url === undefined) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
@ -71,7 +71,8 @@
module.verbose('Address library found adding state change event');
$.address
.state(settings.path)
.change(module.event.history.change)
.unbind('change')
.bind('change', module.event.history.change)
;
}
}
@ -160,7 +161,14 @@
change: function(tabPath) {
var
pathArray = module.get.defaultPathArray(tabPath)
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
// only get default path if not remote content
pathArray = (remoteContent && !shouldIgnoreLoad)
? module.utils.pathToArray(tabPath)
: module.get.defaultPathArray(tabPath),
tabPath = module.utils.arrayToPath(pathArray)
;
module.deactivate.all();
$.each(pathArray, function(index, tab) {
@ -171,10 +179,6 @@
isTab = module.is.tab(currentPath),
isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
@ -195,8 +199,10 @@
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
if(isLastTab) {
module.verbose('Tab parameters found', nextPathArray);
}
}
if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath);
@ -208,14 +214,15 @@
module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.error(errors.missingTab, tab);
@ -245,6 +252,7 @@
module.debug('Content loaded in background', tabPath);
}
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
},
@ -255,7 +263,7 @@
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath);
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
module.debug('Content is already loading', fullTabPath);
@ -297,10 +305,10 @@
},
navigation: function(tabPath) {
var
$nav = module.get.navElement(tabPath)
$navigation = module.get.navElement(tabPath)
;
module.verbose('Activating tab navigation for', $nav);
$nav.addClass(className.active);
module.verbose('Activating tab navigation for', $navigation, tabPath);
$navigation.addClass(className.active);
}
},
@ -354,6 +362,9 @@
}
module.error(errors.recursion);
}
else {
module.debug('No default tabs found for', tabPath);
}
recursionDepth = 0;
return tabPath;
},

2
build/minified/modules/tab.min.js

File diff suppressed because one or more lines are too long

35
build/packaged/modules/tab.js

@ -62,7 +62,7 @@
return false;
}
else {
if(!settings.apiSettings) {
if($.isPlainObject(settings.apiSettings) && settings.action === undefined && settings.url === undefined) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
@ -71,7 +71,8 @@
module.verbose('Address library found adding state change event');
$.address
.state(settings.path)
.change(module.event.history.change)
.unbind('change')
.bind('change', module.event.history.change)
;
}
}
@ -160,7 +161,14 @@
change: function(tabPath) {
var
pathArray = module.get.defaultPathArray(tabPath)
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
// only get default path if not remote content
pathArray = (remoteContent && !shouldIgnoreLoad)
? module.utils.pathToArray(tabPath)
: module.get.defaultPathArray(tabPath),
tabPath = module.utils.arrayToPath(pathArray)
;
module.deactivate.all();
$.each(pathArray, function(index, tab) {
@ -171,10 +179,6 @@
isTab = module.is.tab(currentPath),
isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
@ -195,8 +199,10 @@
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
if(isLastTab) {
module.verbose('Tab parameters found', nextPathArray);
}
}
if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath);
@ -208,14 +214,15 @@
module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.error(errors.missingTab, tab);
@ -245,6 +252,7 @@
module.debug('Content loaded in background', tabPath);
}
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
},
@ -255,7 +263,7 @@
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath);
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
module.debug('Content is already loading', fullTabPath);
@ -297,10 +305,10 @@
},
navigation: function(tabPath) {
var
$nav = module.get.navElement(tabPath)
$navigation = module.get.navElement(tabPath)
;
module.verbose('Activating tab navigation for', $nav);
$nav.addClass(className.active);
module.verbose('Activating tab navigation for', $navigation, tabPath);
$navigation.addClass(className.active);
}
},
@ -354,6 +362,9 @@
}
module.error(errors.recursion);
}
else {
module.debug('No default tabs found for', tabPath);
}
recursionDepth = 0;
return tabPath;
},

2
build/packaged/semantic.min.js.REMOVED.git-id

@ -1 +1 @@
961672b84f3f52255c73991920d39065c129dc63
cdb6cb010bf7ebc91a85709b7065a1eda3bdf842

35
build/uncompressed/modules/tab.js

@ -62,7 +62,7 @@
return false;
}
else {
if(!settings.apiSettings) {
if($.isPlainObject(settings.apiSettings) && settings.action === undefined && settings.url === undefined) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
@ -71,7 +71,8 @@
module.verbose('Address library found adding state change event');
$.address
.state(settings.path)
.change(module.event.history.change)
.unbind('change')
.bind('change', module.event.history.change)
;
}
}
@ -160,7 +161,14 @@
change: function(tabPath) {
var
pathArray = module.get.defaultPathArray(tabPath)
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
// only get default path if not remote content
pathArray = (remoteContent && !shouldIgnoreLoad)
? module.utils.pathToArray(tabPath)
: module.get.defaultPathArray(tabPath),
tabPath = module.utils.arrayToPath(pathArray)
;
module.deactivate.all();
$.each(pathArray, function(index, tab) {
@ -171,10 +179,6 @@
isTab = module.is.tab(currentPath),
isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
@ -195,8 +199,10 @@
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
if(isLastTab) {
module.verbose('Tab parameters found', nextPathArray);
}
}
if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath);
@ -208,14 +214,15 @@
module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.error(errors.missingTab, tab);
@ -245,6 +252,7 @@
module.debug('Content loaded in background', tabPath);
}
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
},
@ -255,7 +263,7 @@
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath);
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
module.debug('Content is already loading', fullTabPath);
@ -297,10 +305,10 @@
},
navigation: function(tabPath) {
var
$nav = module.get.navElement(tabPath)
$navigation = module.get.navElement(tabPath)
;
module.verbose('Activating tab navigation for', $nav);
$nav.addClass(className.active);
module.verbose('Activating tab navigation for', $navigation, tabPath);
$navigation.addClass(className.active);
}
},
@ -354,6 +362,9 @@
}
module.error(errors.recursion);
}
else {
module.debug('No default tabs found for', tabPath);
}
recursionDepth = 0;
return tabPath;
},

35
node/src/files/components/semantic/modules/tab.js

@ -62,7 +62,7 @@
return false;
}
else {
if(!settings.apiSettings) {
if($.isPlainObject(settings.apiSettings) && settings.action === undefined && settings.url === undefined) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
@ -71,7 +71,8 @@
module.verbose('Address library found adding state change event');
$.address
.state(settings.path)
.change(module.event.history.change)
.unbind('change')
.bind('change', module.event.history.change)
;
}
}
@ -160,7 +161,14 @@
change: function(tabPath) {
var
pathArray = module.get.defaultPathArray(tabPath)
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
// only get default path if not remote content
pathArray = (remoteContent && !shouldIgnoreLoad)
? module.utils.pathToArray(tabPath)
: module.get.defaultPathArray(tabPath),
tabPath = module.utils.arrayToPath(pathArray)
;
module.deactivate.all();
$.each(pathArray, function(index, tab) {
@ -171,10 +179,6 @@
isTab = module.is.tab(currentPath),
isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
@ -195,8 +199,10 @@
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
if(isLastTab) {
module.verbose('Tab parameters found', nextPathArray);
}
}
if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath);
@ -208,14 +214,15 @@
module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.error(errors.missingTab, tab);
@ -245,6 +252,7 @@
module.debug('Content loaded in background', tabPath);
}
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
},
@ -255,7 +263,7 @@
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath);
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
module.debug('Content is already loading', fullTabPath);
@ -297,10 +305,10 @@
},
navigation: function(tabPath) {
var
$nav = module.get.navElement(tabPath)
$navigation = module.get.navElement(tabPath)
;
module.verbose('Activating tab navigation for', $nav);
$nav.addClass(className.active);
module.verbose('Activating tab navigation for', $navigation, tabPath);
$navigation.addClass(className.active);
}
},
@ -354,6 +362,9 @@
}
module.error(errors.recursion);
}
else {
module.debug('No default tabs found for', tabPath);
}
recursionDepth = 0;
return tabPath;
},

4
node/src/files/stylesheets/semantic.css

@ -236,7 +236,9 @@ a:hover {
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
font-size: 0.85em;
}
#example #menu .item .item {
font-size: 0.875rem;
}
#example .sidr .ui.menu {

35
src/modules/tab.js

@ -62,7 +62,7 @@
return false;
}
else {
if(!settings.apiSettings) {
if($.isPlainObject(settings.apiSettings) && settings.action === undefined && settings.url === undefined) {
module.debug('No API url found, using current url');
settings.apiSettings = {
url: settings.path + '/{$tab}'
@ -71,7 +71,8 @@
module.verbose('Address library found adding state change event');
$.address
.state(settings.path)
.change(module.event.history.change)
.unbind('change')
.bind('change', module.event.history.change)
;
}
}
@ -160,7 +161,14 @@
change: function(tabPath) {
var
pathArray = module.get.defaultPathArray(tabPath)
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
// only get default path if not remote content
pathArray = (remoteContent && !shouldIgnoreLoad)
? module.utils.pathToArray(tabPath)
: module.get.defaultPathArray(tabPath),
tabPath = module.utils.arrayToPath(pathArray)
;
module.deactivate.all();
$.each(pathArray, function(index, tab) {
@ -171,10 +179,6 @@
isTab = module.is.tab(currentPath),
isLastIndex = (index + 1 == pathArray.length),
pushStateAvailable = (window.history && window.history.pushState),
shouldIgnoreLoad = (pushStateAvailable && settings.ignoreFirstLoad && firstLoad),
remoteContent = $.isPlainObject(settings.apiSettings),
$tab = module.get.tabElement(currentPath),
nextPathArray,
nextPath,
@ -195,8 +199,10 @@
nextPathArray = pathArray.slice(0, index + 2);
nextPath = module.utils.arrayToPath(nextPathArray);
isLastTab = ( !module.is.tab(nextPath) );
if(isLastTab) {
module.verbose('Tab parameters found', nextPathArray);
}
}
if(isLastTab && remoteContent) {
if(!shouldIgnoreLoad) {
module.activate.navigation(currentPath);
@ -208,14 +214,15 @@
module.cache.add(tabPath, $tab.html());
module.activate.all(currentPath);
$.proxy(settings.onTabInit, $tab)(currentPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.debug('Opened local tab', currentPath);
module.activate.all(currentPath);
$.proxy(settings.onTabLoad, $tab)(currentPath, parameterArray, historyEvent);
}
return false;
}
else {
module.error(errors.missingTab, tab);
@ -245,6 +252,7 @@
module.debug('Content loaded in background', tabPath);
}
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
},
urlData: { tab: fullTabPath }
},
@ -255,7 +263,7 @@
module.debug('Showing existing content', fullTabPath);
module.content.update(tabPath, cachedContent);
module.activate.tab(tabPath);
$.proxy(settings.onTabInit, $tab)(tabPath, parameterArray, historyEvent);
$.proxy(settings.onTabLoad, $tab)(tabPath, parameterArray, historyEvent);
}
else if(existingRequest) {
module.debug('Content is already loading', fullTabPath);
@ -297,10 +305,10 @@
},
navigation: function(tabPath) {
var
$nav = module.get.navElement(tabPath)
$navigation = module.get.navElement(tabPath)
;
module.verbose('Activating tab navigation for', $nav);
$nav.addClass(className.active);
module.verbose('Activating tab navigation for', $navigation, tabPath);
$navigation.addClass(className.active);
}
},
@ -354,6 +362,9 @@
}
module.error(errors.recursion);
}
else {
module.debug('No default tabs found for', tabPath);
}
recursionDepth = 0;
return tabPath;
},

Loading…
Cancel
Save