Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master' into develo…
Browse files Browse the repository at this point in the history
…pment
  • Loading branch information
mike-goodwin committed Apr 25, 2017
2 parents d2aba83 + eb14177 commit 6314bab
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

# pug-bootstrap

A port of [JADE-Bootstrap](http://rajasegar.github.io/JADE-Bootstrap/) from jade to pug.
A port of [JADE-Bootstrap](http://rajasegar.github.io/JADE-Bootstrap/) from jade to pug.

This repo is for modifing several bugs found in the original repo [pug-bootstrap](https://github.com/mike-goodwin/pug-bootstrap)
6 changes: 3 additions & 3 deletions components/tabs.pug
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mixin tab-pills-list(tabs,active,options)
mixin tab(id,active,options)
- options = options || {};
- var style = options.style || '';
- style = style.replace(/\bnav-pane\b/, '')
- style = style.replace(/\btab-pane\b/, '')
- if(active && style.indexOf("active") == -1) style += (style.length == 0 ? "active" : " active")
.nav-pane(id=`tab${id}`, class=style)
block
.tab-pane(id=`tab${id}`, class=style)
block
14 changes: 7 additions & 7 deletions test/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('Tabs', function () {

it('should render nav tabs with content', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab-list.pug'));
var expected = '<ul class="nav nav-tabs" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content"><div class="nav-pane active" id="tabitem1"></div><div class="nav-pane" id="tabitem2"></div><div class="nav-pane test" id="tabitem3"></div></div>';
var expected = '<ul class="nav nav-tabs" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content"><div class="tab-pane active" id="tabitem1"></div><div class="tab-pane" id="tabitem2"></div><div class="tab-pane test" id="tabitem3"></div></div>';
var locals = {
tabs: items,
active: 1
Expand All @@ -39,7 +39,7 @@ describe('Tabs', function () {

it('should render nav tabs headers with custom styles and content', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab-list.pug'));
var expected = '<ul class="nav nav-tabs test" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content"><div class="nav-pane active" id="tabitem1"></div><div class="nav-pane" id="tabitem2"></div><div class="nav-pane test" id="tabitem3"></div></div>';
var expected = '<ul class="nav nav-tabs test" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content"><div class="tab-pane active" id="tabitem1"></div><div class="tab-pane" id="tabitem2"></div><div class="tab-pane test" id="tabitem3"></div></div>';
var locals = {
tabs: items,
active: 1,
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('Tabs', function () {

it('should render nav pills with content', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab-pills.pug'));
var expected = '<ul class="nav nav-pills" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content clearfix"><div class="nav-pane active" id="tabitem1"></div><div class="nav-pane" id="tabitem2"></div><div class="nav-pane test" id="tabitem3"></div></div>';
var expected = '<ul class="nav nav-pills" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content clearfix"><div class="tab-pane active" id="tabitem1"></div><div class="tab-pane" id="tabitem2"></div><div class="tab-pane test" id="tabitem3"></div></div>';
var locals = {
tabs: items,
active: 1
Expand All @@ -81,7 +81,7 @@ describe('Tabs', function () {

it('should render nav pills headers with custom styles and content', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab-pills.pug'));
var expected = '<ul class="nav nav-pills test" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content clearfix"><div class="nav-pane active" id="tabitem1"></div><div class="nav-pane" id="tabitem2"></div><div class="nav-pane test" id="tabitem3"></div></div>';
var expected = '<ul class="nav nav-pills test" role="tablist"><li><a href="#tabitem1" role="tab" data-toggle="tab">item1</a></li><li class="active"><a href="#tabitem2" role="tab" data-toggle="tab">item2</a></li><li><a href="#tabitem3" role="tab" data-toggle="tab">item3</a></li></ul><div class="tab-content clearfix"><div class="tab-pane active" id="tabitem1"></div><div class="tab-pane" id="tabitem2"></div><div class="tab-pane test" id="tabitem3"></div></div>';
var locals = {
tabs: items,
active: 1,
Expand All @@ -92,7 +92,7 @@ describe('Tabs', function () {

it('should render active tab', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab.pug'));
var expected = '<div class="nav-pane active" id="tabtest"></div>';
var expected = '<div class="tab-pane active" id="tabtest"></div>';
var locals = {
id: 'test',
active: true
Expand All @@ -102,7 +102,7 @@ describe('Tabs', function () {

it('should render tab with custom styles', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab.pug'));
var expected = '<div class="nav-pane test" id="tabtest"></div>';
var expected = '<div class="tab-pane test" id="tabtest"></div>';
var locals = {
id: 'test',
active: false,
Expand All @@ -113,7 +113,7 @@ describe('Tabs', function () {

it('should render active tab with custom styles', function () {
var fn = pug.compileFile(path.join(__dirname, "fixtures/tabs", 'tab.pug'));
var expected = '<div class="nav-pane test active" id="tabtest"></div>';
var expected = '<div class="tab-pane test active" id="tabtest"></div>';
var locals = {
id: 'test',
active: true,
Expand Down

0 comments on commit 6314bab

Please sign in to comment.