Skip to content

Commit

Permalink
Updated component to version 2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Semantic-Pusher-Robot committed Jun 26, 2016
1 parent a8812dd commit c5c95f7
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 66 deletions.
11 changes: 11 additions & 0 deletions RELEASE-NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
### Version 2.2.0 - June 26, 2016

- **NPM** - NPM dependencies have all been updated to latest stable releases
- **Table** - `definition table` now includes additional class names for forcing, or ignoring definition cell styles
- **Tab** - Added new setting `cacheType`, can either be `html` or `response` (default). HTML will cache resulting html after callbacks, `response` will cache the original response so that it can be played back identically on future loads [#2534](https://github.com/Semantic-Org/Semantic-UI/issues/2534)
- **Tab** - Added new option `deactivate`, defaults to `siblings` which will only deactivate tab activators that are DOM siblings elements to the activating element. Setting it to <code>'all'</code> will deactivate any other tab element initialized at the same time.
- **Table** - `definition table` now supports `definition` variation to specify definition styles on an element that is not `:first-child`
- **Table** - `definition table` now supports `ignored` variation to force a `first-child` to ignore its default definition stylings
- **Menu** - `tabular menu` now has correct bottom margin [#4167](https://github.com/Semantic-Org/Semantic-UI/issues/4167)
- **Table** - `striped selectable` table would not correctly show hover color on striped rows

### Version 2.1.7 - Dec 19, 2015

- **Menu** - Fixed `1px` offset when `attached segment` follows `tabular menu` (max of 2 consecutive segments) [#3479](https://github.com/Semantic-Org/Semantic-UI/issues/3479)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"framework"
],
"license": "MIT",
"version": "2.1.7"
"version": "2.2.0"
}
86 changes: 58 additions & 28 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*!
* # Semantic UI 2.1.7 - Tab
* # Semantic UI 2.2.0 - Tab
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
Expand All @@ -13,6 +12,13 @@

"use strict";

window = (typeof window != 'undefined' && window.Math == Math)
? window
: (typeof self != 'undefined' && self.Math == Math)
? self
: Function('return this')()
;

var _module = module;
module.exports = function(parameters) {

Expand Down Expand Up @@ -449,7 +455,9 @@ module.exports = function(parameters) {
'X-Remote': true
},
onSuccess : function(response) {
module.cache.add(fullTabPath, response);
if(settings.cacheType == 'response') {
module.cache.add(fullTabPath, response);
}
module.update.content(tabPath, response);
if(tabPath == activeTabPath) {
module.debug('Content loaded', tabPath);
Expand All @@ -460,6 +468,9 @@ module.exports = function(parameters) {
}
settings.onFirstLoad.call($tab[0], tabPath, parameterArray, historyEvent);
settings.onLoad.call($tab[0], tabPath, parameterArray, historyEvent);
if(settings.cacheType != 'response') {
module.cache.add(fullTabPath, $tab.html());
}
},
urlData: {
tab: fullTabPath
Expand Down Expand Up @@ -509,15 +520,19 @@ module.exports = function(parameters) {
},
tab: function(tabPath) {
var
$tab = module.get.tabElement(tabPath),
isActive = $tab.hasClass(className.active)
$tab = module.get.tabElement(tabPath),
$deactiveTabs = (settings.deactivate == 'siblings')
? $tab.siblings($tabs)
: $tabs.not($tab),
isActive = $tab.hasClass(className.active)
;
module.verbose('Showing tab content for', $tab);
if(!isActive) {
$tab
.addClass(className.active)
.siblings($tabs)
.removeClass(className.active + ' ' + className.loading)
;
$deactiveTabs
.removeClass(className.active + ' ' + className.loading)
;
if($tab.length > 0) {
settings.onVisible.call($tab[0], tabPath);
Expand All @@ -526,15 +541,19 @@ module.exports = function(parameters) {
},
navigation: function(tabPath) {
var
$navigation = module.get.navElement(tabPath),
$navigation = module.get.navElement(tabPath),
$deactiveNavigation = (settings.deactivate == 'siblings')
? $navigation.siblings($allModules)
: $allModules.not($navigation),
isActive = $navigation.hasClass(className.active)
;
module.verbose('Activating tab navigation for', $navigation, tabPath);
if(!isActive) {
$navigation
.addClass(className.active)
.siblings($allModules)
.removeClass(className.active + ' ' + className.loading)
;
$deactiveNavigation
.removeClass(className.active + ' ' + className.loading)
;
}
}
Expand Down Expand Up @@ -657,7 +676,12 @@ module.exports = function(parameters) {
$.extend(true, settings, name);
}
else if(value !== undefined) {
settings[name] = value;
if($.isPlainObject(settings[name])) {
$.extend(true, settings[name], value);
}
else {
settings[name] = value;
}
}
else {
return settings[name];
Expand All @@ -675,7 +699,7 @@ module.exports = function(parameters) {
}
},
debug: function() {
if(settings.debug) {
if(!settings.silent && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
Expand All @@ -686,7 +710,7 @@ module.exports = function(parameters) {
}
},
verbose: function() {
if(settings.verbose && settings.debug) {
if(!settings.silent && settings.verbose && settings.debug) {
if(settings.performance) {
module.performance.log(arguments);
}
Expand All @@ -697,8 +721,10 @@ module.exports = function(parameters) {
}
},
error: function() {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
if(!settings.silent) {
module.error = Function.prototype.bind.call(console.error, console, settings.name + ':');
module.error.apply(console, arguments);
}
},
performance: {
log: function(message) {
Expand Down Expand Up @@ -837,32 +863,36 @@ _module.exports.settings = {
name : 'Tab',
namespace : 'tab',

silent : false,
debug : false,
verbose : false,
performance : 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
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

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

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
deactivate : 'siblings', // whether tabs should deactivate sibling menu elements or all elements initialized together

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
alwaysRefresh : false, // load tab content new every tab click
cache : true, // cache the content requests to pull locally
cacheType : 'response', // Whether to cache exact response, or to html cache contents after scripts execute
ignoreFirstLoad : false, // don't load remote content on first load

apiSettings : false, // settings for api call
evaluateScripts : 'once', // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content
apiSettings : false, // settings for api call
evaluateScripts : 'once', // whether inline scripts should be parsed (true/false/once). Once will not re-evaluate on cached content

onFirstLoad : function(tabPath, parameterArray, historyEvent) {}, // called first time loaded
onLoad : function(tabPath, parameterArray, historyEvent) {}, // called on every load
onVisible : function(tabPath, parameterArray, historyEvent) {}, // called every time tab visible
onRequest : function(tabPath, parameterArray, historyEvent) {}, // called ever time a tab beings loading remote content

templates : {
templates : {
determineTitle: function(tabArray) {} // returns page title for path
},

Expand Down
2 changes: 1 addition & 1 deletion package.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Package.describe({
name : 'semantic:ui-tab',
summary : 'Semantic UI - Tab: Single component release',
version : '2.1.7',
version : '2.2.0',
git : 'git://github.com/Semantic-Org/UI-Tab.git',
});

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "semantic-ui-tab",
"version": "2.1.7",
"version": "2.2.0",
"title": "Semantic UI - Tab",
"description": "Single component release of tab",
"homepage": "http://www.semantic-ui.com",
Expand Down
3 changes: 1 addition & 2 deletions tab.css
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*!
* # Semantic UI 2.1.7 - Tab
* # Semantic UI 2.2.0 - Tab
* http://github.com/semantic-org/semantic-ui/
*
*
* Copyright 2015 Contributors
* Released under the MIT license
* http://opensource.org/licenses/MIT
*
Expand Down
Loading

0 comments on commit c5c95f7

Please sign in to comment.