From 4801564390ae410166c864ff8b8fd4cf378c60a9 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Sun, 27 Oct 2013 18:00:12 +0100 Subject: [PATCH 0001/1655] refactor(alert): clean-up unused variables --- src/alert/alert.js | 2 +- src/alert/test/alert.spec.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alert/alert.js b/src/alert/alert.js index 07f68dde5b..b8bb392a1a 100644 --- a/src/alert/alert.js +++ b/src/alert/alert.js @@ -8,7 +8,7 @@ angular.module("ui.bootstrap.alert", []).directive('alert', function () { type: '=', close: '&' }, - link: function(scope, iElement, iAttrs, controller) { + link: function(scope, iElement, iAttrs) { scope.closeable = "close" in iAttrs; } }; diff --git a/src/alert/test/alert.spec.js b/src/alert/test/alert.spec.js index 0ffbc241a7..29d9225716 100644 --- a/src/alert/test/alert.spec.js +++ b/src/alert/test/alert.spec.js @@ -1,6 +1,6 @@ describe("alert", function () { - var scope, ctrl, model, $compile; + var scope, $compile; var element; beforeEach(module('ui.bootstrap.alert')); From cc2df9a02d0def9426798743f297482c9a8b387d Mon Sep 17 00:00:00 2001 From: scarletsky Date: Sun, 20 Oct 2013 18:03:26 +0800 Subject: [PATCH 0002/1655] docs(README): add info about templates customization --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/README.md b/README.md index 9652a72bbd..71207d2139 100644 --- a/README.md +++ b/README.md @@ -87,6 +87,61 @@ Check the Grunt build file for other tasks that are defined for this project. This will start Karma server and will continously watch files in the project, executing tests upon every change. +### Customize templates + +As mentioned directives from this repository have all the markup externalized in templates. You might want to customize default +templates to match your desired look & feel, add new functionality etc. + +The easiest way to override an individual template is to use the +``` + +If you want to override more templates it makes sense to store them as individual files and feed the `$templateCache` from those partials. +For people using Grunt as the build tool it can be easily done using the `grunt-html2js` plugin. You can also configure your own template url. +Let's have a look: + +Your own template url is `views/partials/ui-bootstrap-tpls/alert/alert.html`. + +Add "html2js" task to your Gruntfile +``` +html2js: { + options: { + base: '.', + module: 'ui-templates', + rename: function (modulePath) { + var moduleName = modulePath.replace('app/views/partials/ui-bootstrap-tpls/', '').replace('.html', ''); + return 'template' + '/' + moduleName + '.html'; + } + }, + main: { + src: ['app/views/partials/ui-bootstrap-tpls/**/*.html'], + dest: '.tmp/ui-templates.js' + } +} +``` + +Make sure to load your template.js file +`` + +Inject the `ui-templates` module in your `app.js` +``` +angular.module('myApp', [ + 'ui.bootstrap', + 'ui-templates' +]); +``` + +Then it will work fine! + +For more information visit: https://github.com/karlgoldstein/grunt-html2js + ### Release * Bump up version number in `package.json` * Commit the version change with the following message: `chore(release): [version number]` From 85647c9b64a03a1382042e301b044d3afd79e0f9 Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Sun, 27 Oct 2013 18:55:45 +0100 Subject: [PATCH 0003/1655] docs(README): fix markup --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 71207d2139..2c0c908c17 100644 --- a/README.md +++ b/README.md @@ -92,7 +92,7 @@ This will start Karma server and will continously watch files in the project, ex As mentioned directives from this repository have all the markup externalized in templates. You might want to customize default templates to match your desired look & feel, add new functionality etc. -The easiest way to override an individual template is to use the

Static arrays

-
Model: {{selected| json}}
+
Model: {{selected | json}}

Asynchronous results

-
Asynchronous values model: {{asyncSelected| json}}
+
Model: {{asyncSelected | json}}
+ +

Custom templates for results

+
Model: {{customSelected | json}}
+
diff --git a/src/typeahead/docs/demo.js b/src/typeahead/docs/demo.js index 01485c5644..3fbcbc001b 100644 --- a/src/typeahead/docs/demo.js +++ b/src/typeahead/docs/demo.js @@ -17,4 +17,6 @@ function TypeaheadCtrl($scope, $http) { return addresses; }); }; -} + + $scope.statesWithFlags = [{"name":"Alabama","flag":"5/5c/Flag_of_Alabama.svg/45px-Flag_of_Alabama.svg.png"},{"name":"Alaska","flag":"e/e6/Flag_of_Alaska.svg/43px-Flag_of_Alaska.svg.png"},{"name":"Arizona","flag":"9/9d/Flag_of_Arizona.svg/45px-Flag_of_Arizona.svg.png"},{"name":"Arkansas","flag":"9/9d/Flag_of_Arkansas.svg/45px-Flag_of_Arkansas.svg.png"},{"name":"California","flag":"0/01/Flag_of_California.svg/45px-Flag_of_California.svg.png"},{"name":"Colorado","flag":"4/46/Flag_of_Colorado.svg/45px-Flag_of_Colorado.svg.png"},{"name":"Connecticut","flag":"9/96/Flag_of_Connecticut.svg/39px-Flag_of_Connecticut.svg.png"},{"name":"Delaware","flag":"c/c6/Flag_of_Delaware.svg/45px-Flag_of_Delaware.svg.png"},{"name":"Florida","flag":"f/f7/Flag_of_Florida.svg/45px-Flag_of_Florida.svg.png"},{"name":"Georgia","flag":"5/54/Flag_of_Georgia_%28U.S._state%29.svg/46px-Flag_of_Georgia_%28U.S._state%29.svg.png"},{"name":"Hawaii","flag":"e/ef/Flag_of_Hawaii.svg/46px-Flag_of_Hawaii.svg.png"},{"name":"Idaho","flag":"a/a4/Flag_of_Idaho.svg/38px-Flag_of_Idaho.svg.png"},{"name":"Illinois","flag":"0/01/Flag_of_Illinois.svg/46px-Flag_of_Illinois.svg.png"},{"name":"Indiana","flag":"a/ac/Flag_of_Indiana.svg/45px-Flag_of_Indiana.svg.png"},{"name":"Iowa","flag":"a/aa/Flag_of_Iowa.svg/44px-Flag_of_Iowa.svg.png"},{"name":"Kansas","flag":"d/da/Flag_of_Kansas.svg/46px-Flag_of_Kansas.svg.png"},{"name":"Kentucky","flag":"8/8d/Flag_of_Kentucky.svg/46px-Flag_of_Kentucky.svg.png"},{"name":"Louisiana","flag":"e/e0/Flag_of_Louisiana.svg/46px-Flag_of_Louisiana.svg.png"},{"name":"Maine","flag":"3/35/Flag_of_Maine.svg/45px-Flag_of_Maine.svg.png"},{"name":"Maryland","flag":"a/a0/Flag_of_Maryland.svg/45px-Flag_of_Maryland.svg.png"},{"name":"Massachusetts","flag":"f/f2/Flag_of_Massachusetts.svg/46px-Flag_of_Massachusetts.svg.png"},{"name":"Michigan","flag":"b/b5/Flag_of_Michigan.svg/45px-Flag_of_Michigan.svg.png"},{"name":"Minnesota","flag":"b/b9/Flag_of_Minnesota.svg/46px-Flag_of_Minnesota.svg.png"},{"name":"Mississippi","flag":"4/42/Flag_of_Mississippi.svg/45px-Flag_of_Mississippi.svg.png"},{"name":"Missouri","flag":"5/5a/Flag_of_Missouri.svg/46px-Flag_of_Missouri.svg.png"},{"name":"Montana","flag":"c/cb/Flag_of_Montana.svg/45px-Flag_of_Montana.svg.png"},{"name":"Nebraska","flag":"4/4d/Flag_of_Nebraska.svg/46px-Flag_of_Nebraska.svg.png"},{"name":"Nevada","flag":"f/f1/Flag_of_Nevada.svg/45px-Flag_of_Nevada.svg.png"},{"name":"New Hampshire","flag":"2/28/Flag_of_New_Hampshire.svg/45px-Flag_of_New_Hampshire.svg.png"},{"name":"New Jersey","flag":"9/92/Flag_of_New_Jersey.svg/45px-Flag_of_New_Jersey.svg.png"},{"name":"New Mexico","flag":"c/c3/Flag_of_New_Mexico.svg/45px-Flag_of_New_Mexico.svg.png"},{"name":"New York","flag":"1/1a/Flag_of_New_York.svg/46px-Flag_of_New_York.svg.png"},{"name":"North Carolina","flag":"b/bb/Flag_of_North_Carolina.svg/45px-Flag_of_North_Carolina.svg.png"},{"name":"North Dakota","flag":"e/ee/Flag_of_North_Dakota.svg/38px-Flag_of_North_Dakota.svg.png"},{"name":"Ohio","flag":"4/4c/Flag_of_Ohio.svg/46px-Flag_of_Ohio.svg.png"},{"name":"Oklahoma","flag":"6/6e/Flag_of_Oklahoma.svg/45px-Flag_of_Oklahoma.svg.png"},{"name":"Oregon","flag":"b/b9/Flag_of_Oregon.svg/46px-Flag_of_Oregon.svg.png"},{"name":"Pennsylvania","flag":"f/f7/Flag_of_Pennsylvania.svg/45px-Flag_of_Pennsylvania.svg.png"},{"name":"Rhode Island","flag":"f/f3/Flag_of_Rhode_Island.svg/32px-Flag_of_Rhode_Island.svg.png"},{"name":"South Carolina","flag":"6/69/Flag_of_South_Carolina.svg/45px-Flag_of_South_Carolina.svg.png"},{"name":"South Dakota","flag":"1/1a/Flag_of_South_Dakota.svg/46px-Flag_of_South_Dakota.svg.png"},{"name":"Tennessee","flag":"9/9e/Flag_of_Tennessee.svg/46px-Flag_of_Tennessee.svg.png"},{"name":"Texas","flag":"f/f7/Flag_of_Texas.svg/45px-Flag_of_Texas.svg.png"},{"name":"Utah","flag":"f/f6/Flag_of_Utah.svg/45px-Flag_of_Utah.svg.png"},{"name":"Vermont","flag":"4/49/Flag_of_Vermont.svg/46px-Flag_of_Vermont.svg.png"},{"name":"Virginia","flag":"4/47/Flag_of_Virginia.svg/44px-Flag_of_Virginia.svg.png"},{"name":"Washington","flag":"5/54/Flag_of_Washington.svg/46px-Flag_of_Washington.svg.png"},{"name":"West Virginia","flag":"2/22/Flag_of_West_Virginia.svg/46px-Flag_of_West_Virginia.svg.png"},{"name":"Wisconsin","flag":"2/22/Flag_of_Wisconsin.svg/45px-Flag_of_Wisconsin.svg.png"},{"name":"Wyoming","flag":"b/bc/Flag_of_Wyoming.svg/43px-Flag_of_Wyoming.svg.png"}]; +} \ No newline at end of file From 672a557ab2a046c9eaee28167df7bcc8da95993c Mon Sep 17 00:00:00 2001 From: plainkeyman Date: Sun, 17 Nov 2013 23:41:18 -0700 Subject: [PATCH 0044/1655] fix(modal): properly animate backdrops on each modal opening Closes #1267 --- src/modal/modal.js | 4 +++- src/modal/test/modal.spec.js | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/modal/modal.js b/src/modal/modal.js index 211a768314..12ddfa8ee4 100644 --- a/src/modal/modal.js +++ b/src/modal/modal.js @@ -62,7 +62,9 @@ angular.module('ui.bootstrap.modal', []) restrict: 'EA', replace: true, templateUrl: 'template/modal/backdrop.html', - link: function (scope, element, attrs) { + link: function (scope) { + + scope.animate = false; //trigger CSS transitions $timeout(function () { diff --git a/src/modal/test/modal.spec.js b/src/modal/test/modal.spec.js index 0ee9c2e1e6..697eec6861 100644 --- a/src/modal/test/modal.spec.js +++ b/src/modal/test/modal.spec.js @@ -375,6 +375,22 @@ describe('$modal', function () { expect($document).toHaveModalOpenWithContent('Static backdrop', 'div'); expect($document).toHaveBackdrop(); }); + + it('should animate backdrop on each modal opening', function () { + + var modal = open({ template: '
With backdrop
' }); + var backdropEl = $document.find('body > div.modal-backdrop'); + expect(backdropEl).not.toHaveClass('in'); + + $timeout.flush(); + expect(backdropEl).toHaveClass('in'); + + dismiss(modal); + modal = open({ template: '
With backdrop
' }); + backdropEl = $document.find('body > div.modal-backdrop'); + expect(backdropEl).not.toHaveClass('in'); + + }); }); describe('custom window classes', function () { From 7a5b42f91cecbf4cb7fcbbe6fd1803991cf5eb28 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Sun, 22 Dec 2013 23:02:15 -0800 Subject: [PATCH 0045/1655] test(tabs): get test coverage to 100% - Add one removal of a non-last tab to test one last branch - This excludes the deprecation message for the tabs directive. --- src/tabs/test/tabs.spec.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/tabs/test/tabs.spec.js b/src/tabs/test/tabs.spec.js index 61215db39b..244c907066 100644 --- a/src/tabs/test/tabs.spec.js +++ b/src/tabs/test/tabs.spec.js @@ -443,16 +443,33 @@ describe('tabs', function() { expectTitles(['1', 'tab 1', 'tab 2', 'tab 3']); expectContents(['Hello', 'content 1', 'content 2', 'content 3']); + // Select last tab titles().find('a').eq(3).click(); expect(contents().eq(3)).toHaveClass('active'); expect(titles().eq(3)).toHaveClass('active'); + // Remove last tab scope.$apply('list = [1,2]'); expectTitles(['1', 'tab 1', 'tab 2']); expectContents(['Hello', 'content 1', 'content 2']); + // "tab 2" is now selected expect(titles().eq(2)).toHaveClass('active'); expect(contents().eq(2)).toHaveClass('active'); + + // Select 2nd tab ("tab 1") + titles().find('a').eq(1).click(); + expect(titles().eq(1)).toHaveClass('active'); + expect(contents().eq(1)).toHaveClass('active'); + + // Remove 2nd tab + scope.$apply('list = [2]'); + expectTitles(['1', 'tab 2']); + expectContents(['Hello', 'content 2']); + + // New 2nd tab is now selected + expect(titles().eq(1)).toHaveClass('active'); + expect(contents().eq(1)).toHaveClass('active'); })); }); From db73cb3334af3c67473723d6d7233a87e282b6cd Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Mon, 23 Dec 2013 10:19:50 +0100 Subject: [PATCH 0046/1655] refactor(tabs): remove unused tabs directive --- src/tabs/tabs.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index dbda75ca29..bef8b4115a 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -9,12 +9,6 @@ angular.module('ui.bootstrap.tabs', []) -.directive('tabs', function() { - return function() { - throw new Error("The `tabs` directive is deprecated, please migrate to `tabset`. Instructions can be found at http://github.com/angular-ui/bootstrap/tree/master/CHANGELOG.md"); - }; -}) - .controller('TabsetController', ['$scope', function TabsetCtrl($scope) { var ctrl = this, tabs = ctrl.tabs = $scope.tabs = []; From d6bf79b461b021c7a35e5757b901762a4beac929 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Thu, 5 Dec 2013 13:21:55 -0800 Subject: [PATCH 0047/1655] chore(tabs): Add tests for nested tabs Relates to #783 --- src/tabs/test/tabs.spec.js | 109 +++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/src/tabs/test/tabs.spec.js b/src/tabs/test/tabs.spec.js index 244c907066..8e7f41f813 100644 --- a/src/tabs/test/tabs.spec.js +++ b/src/tabs/test/tabs.spec.js @@ -664,4 +664,113 @@ describe('tabs', function() { expect(contents.eq(2).text().trim()).toEqual('3,4,5,'); })); }); + + //https://github.com/angular-ui/bootstrap/issues/783 + describe('nested tabs', function() { + var elm; + it('should render without errors', inject(function($compile, $rootScope) { + var scope = $rootScope.$new(); + elm = $compile([ + '
', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '
' + ].join('\n'))(scope); + scope.$apply(); + + // 1 outside tabset, 2 nested tabsets + expect(elm.find('.tabbable').length).toEqual(3); + })); + + it('should render with the correct scopes', inject(function($compile, $rootScope) { + var scope = $rootScope.$new(); + scope.tab1Text = 'abc'; + scope.tab1aText = '123'; + scope.tab1aHead = '123'; + scope.tab2aaText = '456'; + elm = $compile([ + '
', + ' ', + ' ', + ' ', + ' ', + ' {{ tab1aText }}', + ' ', + ' ', + ' {{ tab1Text }}', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + ' {{ tab2aaText }}', + ' ', + ' ', + ' ', + ' ', + ' ', + ' ', + '
' + ].join('\n'))(scope); + scope.$apply(); + + var outsideTabset = elm.find('.tabbable').eq(0); + var nestedTabset = outsideTabset.find('.tabbable'); + + expect(elm.find('.tabbable').length).toEqual(4); + expect(outsideTabset.find('.tab-pane').eq(0).find('.tab-1').text().trim()).toEqual(scope.tab1Text); + expect(nestedTabset.find('.tab-pane').eq(0).text().trim()).toEqual(scope.tab1aText); + expect(nestedTabset.find('ul.nav-tabs li').eq(0).text().trim()).toEqual(scope.tab1aHead); + expect(nestedTabset.eq(2).find('.tab-pane').eq(0).find('.tab-2aa').text().trim()).toEqual(scope.tab2aaText); + })); + + it('ng-repeat works with nested tabs', inject(function($compile, $rootScope) { + var scope = $rootScope.$new(); + scope.tabs = [ + { + tabs: [ + { + content: 'tab1a' + }, + { + content: 'tab2a' + } + ], + content: 'tab1' + } + ]; + elm = $compile([ + '
', + ' ', + ' ', + ' ', + ' ', + ' {{ innerTab.content }}', + ' ', + ' ', + ' {{ tab.content }}', + ' ', + ' ', + '
' + ].join('\n'))(scope); + scope.$apply(); + + expect(elm.find('.inner-tab-content').eq(0).text().trim()).toEqual(scope.tabs[0].tabs[0].content); + expect(elm.find('.inner-tab-content').eq(1).text().trim()).toEqual(scope.tabs[0].tabs[1].content); + expect(elm.find('.outer-tab-content').eq(0).text().trim()).toEqual(scope.tabs[0].content); + })); + }); }); From c9acebbea2fdbb01ee3283b1bae0e0543d4c8cb2 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Fri, 13 Dec 2013 14:19:23 -0800 Subject: [PATCH 0048/1655] fix(tabs): make nested tabs work This reverts commit 220e7b60124105aca25e57c3f01a22e12fa77cc2. Revert the capability to set the tab direction. This is no longer a feature in Bootstrap 3 and breaks nested tabs. Closes #783 Relates to #659 --- src/tabs/tabs.js | 34 +++------------------ src/tabs/test/tabs.spec.js | 52 +------------------------------- template/tabs/tabset-titles.html | 2 -- template/tabs/tabset.html | 6 ++-- 4 files changed, 8 insertions(+), 86 deletions(-) delete mode 100644 template/tabs/tabset-titles.html diff --git a/src/tabs/tabs.js b/src/tabs/tabs.js index bef8b4115a..ce5d1b9923 100644 --- a/src/tabs/tabs.js +++ b/src/tabs/tabs.js @@ -48,8 +48,6 @@ angular.module('ui.bootstrap.tabs', []) * Tabset is the outer container for the tabs directive * * @param {boolean=} vertical Whether or not to use vertical styling for the tabs. - * @param {string=} direction What direction the tabs should be rendered. Available: - * 'right', 'left', 'below'. * * @example @@ -71,19 +69,12 @@ angular.module('ui.bootstrap.tabs', []) restrict: 'EA', transclude: true, replace: true, - require: '^tabset', scope: {}, controller: 'TabsetController', templateUrl: 'template/tabs/tabset.html', - compile: function(elm, attrs, transclude) { - return function(scope, element, attrs, tabsetCtrl) { - scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false; - scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs'; - scope.direction = angular.isDefined(attrs.direction) ? scope.$parent.$eval(attrs.direction) : 'top'; - scope.tabsAbove = (scope.direction != 'below'); - tabsetCtrl.$scope = scope; - tabsetCtrl.$transcludeFn = transclude; - }; + link: function(scope, element, attrs) { + scope.vertical = angular.isDefined(attrs.vertical) ? scope.$parent.$eval(attrs.vertical) : false; + scope.type = angular.isDefined(attrs.type) ? scope.$parent.$eval(attrs.type) : 'tabs'; } }; }) @@ -288,21 +279,4 @@ angular.module('ui.bootstrap.tabs', []) } }) -.directive('tabsetTitles', function() { - return { - restrict: 'A', - require: '^tabset', - templateUrl: 'template/tabs/tabset-titles.html', - replace: true, - link: function(scope, elm, attrs, tabsetCtrl) { - if (!scope.$eval(attrs.tabsetTitles)) { - elm.remove(); - } else { - //now that tabs location has been decided, transclude the tab titles in - tabsetCtrl.$transcludeFn(tabsetCtrl.$scope.$parent, function(node) { - elm.append(node); - }); - } - } - }; -}); +; diff --git a/src/tabs/test/tabs.spec.js b/src/tabs/test/tabs.spec.js index 8e7f41f813..2ead88c5cf 100644 --- a/src/tabs/test/tabs.spec.js +++ b/src/tabs/test/tabs.spec.js @@ -1,5 +1,5 @@ describe('tabs', function() { - beforeEach(module('ui.bootstrap.tabs', 'template/tabs/tabset.html', 'template/tabs/tab.html', 'template/tabs/tabset-titles.html')); + beforeEach(module('ui.bootstrap.tabs', 'template/tabs/tabset.html', 'template/tabs/tab.html')); var elm, scope; function titles() { @@ -561,56 +561,6 @@ describe('tabs', function() { }); }); - describe('direction', function() { - it('should not have `tab-left`, `tab-right` nor `tabs-below` classes if the direction is undefined', inject(function($compile, $rootScope) { - scope = $rootScope.$new(); - scope.direction = undefined; - - elm = $compile('')(scope); - scope.$apply(); - expect(elm).not.toHaveClass('tabs-left'); - expect(elm).not.toHaveClass('tabs-right'); - expect(elm).not.toHaveClass('tabs-below'); - expect(elm.find('.nav + .tab-content').length).toBe(1); - })); - - it('should only have the `tab-left` direction class if the direction is "left"', inject(function($compile, $rootScope) { - scope = $rootScope.$new(); - scope.direction = 'left'; - - elm = $compile('')(scope); - scope.$apply(); - expect(elm).toHaveClass('tabs-left'); - expect(elm).not.toHaveClass('tabs-right'); - expect(elm).not.toHaveClass('tabs-below'); - expect(elm.find('.nav + .tab-content').length).toBe(1); - })); - - it('should only have the `tab-right direction class if the direction is "right"', inject(function($compile, $rootScope) { - scope = $rootScope.$new(); - scope.direction = 'right'; - - elm = $compile('')(scope); - scope.$apply(); - expect(elm).not.toHaveClass('tabs-left'); - expect(elm).toHaveClass('tabs-right'); - expect(elm).not.toHaveClass('tabs-below'); - expect(elm.find('.nav + .tab-content').length).toBe(1); - })); - - it('should only have the `tab-below direction class if the direction is "below"', inject(function($compile, $rootScope) { - scope = $rootScope.$new(); - scope.direction = 'below'; - - elm = $compile('')(scope); - scope.$apply(); - expect(elm).not.toHaveClass('tabs-left'); - expect(elm).not.toHaveClass('tabs-right'); - expect(elm).toHaveClass('tabs-below'); - expect(elm.find('.tab-content + .nav').length).toBe(1); - })); - }); - //https://github.com/angular-ui/bootstrap/issues/524 describe('child compilation', function() { diff --git a/template/tabs/tabset-titles.html b/template/tabs/tabset-titles.html deleted file mode 100644 index 560e0f743f..0000000000 --- a/template/tabs/tabset-titles.html +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/template/tabs/tabset.html b/template/tabs/tabset.html index 5e9798b2c8..ffe289f882 100644 --- a/template/tabs/tabset.html +++ b/template/tabs/tabset.html @@ -1,6 +1,7 @@ -
-
+
+
-
From 5b9d929c376a65f170c9a4d31ecbb7fa8a4181c3 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Mon, 23 Dec 2013 03:44:29 -0800 Subject: [PATCH 0049/1655] fix(carousel): cancel timer on scope destruction Closes #1414 --- src/carousel/carousel.js | 9 +++++++++ src/carousel/test/carousel.spec.js | 14 ++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index cb7d585173..76173e3fc6 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -106,6 +106,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) function restartTimer() { if (currentTimeout) { $timeout.cancel(currentTimeout); + currentTimeout = null; } function go() { if (isPlaying) { @@ -131,6 +132,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) isPlaying = false; if (currentTimeout) { $timeout.cancel(currentTimeout); + currentTimeout = null; } } }; @@ -163,6 +165,13 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) currentIndex--; } }; + + $scope.$on('$destroy', function () { + if (currentTimeout) { + $timeout.cancel(currentTimeout); + currentTimeout = null; + } + }); }]) /** diff --git a/src/carousel/test/carousel.spec.js b/src/carousel/test/carousel.spec.js index 0bea1d3daa..78d41699c3 100644 --- a/src/carousel/test/carousel.spec.js +++ b/src/carousel/test/carousel.spec.js @@ -294,6 +294,20 @@ describe('carousel', function() { expect(ctrl.slides.length).toBe(1); expect(ctrl.currentSlide).toBe(ctrl.slides[0]); }); + + it('issue 1414 - should not continue running timers after scope is destroyed', function() { + spyOn(scope, 'next').andCallThrough(); + scope.interval = 2000; + scope.$digest(); + + $timeout.flush(); + expect(scope.next.calls.length).toBe(1); + + scope.$destroy(); + + $timeout.flush(scope.interval); + expect(scope.next.calls.length).toBe(1); + }); }); }); }); From 0b3999421bc16510f096282baccd55884ae67df8 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Mon, 23 Dec 2013 04:16:49 -0800 Subject: [PATCH 0050/1655] refactor(carousel): remove duplicate code Move go function out of restartTimer as it doesn't need to be re-created during each interval. --- src/carousel/carousel.js | 41 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index 76173e3fc6..854b3b6fe4 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -103,24 +103,32 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) }; $scope.$watch('interval', restartTimer); + $scope.$on('$destroy', resetTimer); + function restartTimer() { + resetTimer(); + var interval = +$scope.interval; + if (!isNaN(interval) && interval>=0) { + currentTimeout = $timeout(timerFn, interval); + } + } + + function resetTimer() { if (currentTimeout) { $timeout.cancel(currentTimeout); currentTimeout = null; } - function go() { - if (isPlaying) { - $scope.next(); - restartTimer(); - } else { - $scope.pause(); - } - } - var interval = +$scope.interval; - if (!isNaN(interval) && interval>=0) { - currentTimeout = $timeout(go, interval); + } + + function timerFn() { + if (isPlaying) { + $scope.next(); + restartTimer(); + } else { + $scope.pause(); } } + $scope.play = function() { if (!isPlaying) { isPlaying = true; @@ -130,10 +138,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) $scope.pause = function() { if (!$scope.noPause) { isPlaying = false; - if (currentTimeout) { - $timeout.cancel(currentTimeout); - currentTimeout = null; - } + resetTimer(); } }; @@ -166,12 +171,6 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) } }; - $scope.$on('$destroy', function () { - if (currentTimeout) { - $timeout.cancel(currentTimeout); - currentTimeout = null; - } - }); }]) /** From 7515df45b9461df6711d16be5b0cac14ed5cf633 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Mon, 23 Dec 2013 13:47:37 -0800 Subject: [PATCH 0051/1655] fix(carousel): cancel goNext on scope destruction Discovered after #1451 --- src/carousel/carousel.js | 6 ++++++ src/carousel/test/carousel.spec.js | 13 +++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/carousel/carousel.js b/src/carousel/carousel.js index 854b3b6fe4..9314ae7512 100644 --- a/src/carousel/carousel.js +++ b/src/carousel/carousel.js @@ -14,6 +14,7 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) currentTimeout, isPlaying; self.currentSlide = null; + var destroyed = false; /* direction: "prev" or "next" */ self.select = function(nextSlide, direction) { var nextIndex = slides.indexOf(nextSlide); @@ -31,6 +32,8 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) } } function goNext() { + // Scope has been destroyed, stop here. + if (destroyed) { return; } //If we have a slide to transition from and we have a transition type and we're allowed, go if (self.currentSlide && angular.isString(direction) && !$scope.noTransition && nextSlide.$element) { //We shouldn't do class manip in here, but it's the same weird thing bootstrap does. need to fix sometime @@ -66,6 +69,9 @@ angular.module('ui.bootstrap.carousel', ['ui.bootstrap.transition']) $scope.$currentTransition = null; } }; + $scope.$on('$destroy', function () { + destroyed = true; + }); /* Allow outside people to call indexOf on slides array */ self.indexOfSlide = function(slide) { diff --git a/src/carousel/test/carousel.spec.js b/src/carousel/test/carousel.spec.js index 78d41699c3..cdbfedcbe2 100644 --- a/src/carousel/test/carousel.spec.js +++ b/src/carousel/test/carousel.spec.js @@ -234,6 +234,19 @@ describe('carousel', function() { next.click(); testSlideActive(1); }); + + it('issue 1414 - should not continue running timers after scope is destroyed', function() { + testSlideActive(0); + $timeout.flush(); + testSlideActive(1); + $timeout.flush(); + testSlideActive(2); + $timeout.flush(); + testSlideActive(0); + scope.$destroy(); + expect($timeout.flush).toThrow('No deferred tasks to be flushed'); + }); + }); describe('controller', function() { From 161a99621bce54767f348a3b0b2359bf52316eae Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Tue, 24 Dec 2013 01:35:38 -0800 Subject: [PATCH 0052/1655] test(typeahead): increase coverage of tests --- src/typeahead/test/typeahead.spec.js | 85 ++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/src/typeahead/test/typeahead.spec.js b/src/typeahead/test/typeahead.spec.js index 5b14b27ae7..90b3dcbc1e 100644 --- a/src/typeahead/test/typeahead.spec.js +++ b/src/typeahead/test/typeahead.spec.js @@ -276,6 +276,13 @@ describe('typeahead tests', function () { expect(findMatches(element).eq(0).find('p').text()).toEqual('0 Alaska'); })); + + it('should throw error on invalid expression', function () { + var prepareInvalidDir = function () { + prepareInputEl("
"); + }; + expect(prepareInvalidDir).toThrow(); + }); }); describe('selecting a match', function () { @@ -354,6 +361,84 @@ describe('typeahead tests', function () { }); }); + describe('pop-up interaction', function () { + var element; + + beforeEach(function () { + element = prepareInputEl("
"); + }); + + it('should activate prev/next matches on up/down keys', function () { + changeInputValueTo(element, 'b'); + expect(element).toBeOpenWithActive(2, 0); + + // Down arrow key + triggerKeyDown(element, 40); + expect(element).toBeOpenWithActive(2, 1); + + // Down arrow key goes back to first element + triggerKeyDown(element, 40); + expect(element).toBeOpenWithActive(2, 0); + + // Up arrow key goes back to last element + triggerKeyDown(element, 38); + expect(element).toBeOpenWithActive(2, 1); + + // Up arrow key goes back to last element + triggerKeyDown(element, 38); + expect(element).toBeOpenWithActive(2, 0); + }); + + it('should close popup on escape key', function () { + changeInputValueTo(element, 'b'); + expect(element).toBeOpenWithActive(2, 0); + + // Escape key + triggerKeyDown(element, 27); + expect(element).toBeClosed(); + }); + + it('should highlight match on mouseenter', function () { + changeInputValueTo(element, 'b'); + expect(element).toBeOpenWithActive(2, 0); + + findMatches(element).eq(1).trigger('mouseenter'); + expect(element).toBeOpenWithActive(2, 1); + }); + + }); + + describe('promises', function () { + var element, deferred; + + beforeEach(inject(function ($q) { + deferred = $q.defer(); + $scope.source = function () { + return deferred.promise; + }; + element = prepareInputEl("
"); + })); + + it('should display matches from promise', function () { + changeInputValueTo(element, 'c'); + expect(element).toBeClosed(); + + deferred.resolve(['good', 'stuff']); + $scope.$digest(); + expect(element).toBeOpenWithActive(2, 0); + }); + + it('should not display anything when promise is rejected', function () { + changeInputValueTo(element, 'c'); + expect(element).toBeClosed(); + + deferred.reject('fail'); + $scope.$digest(); + expect(element).toBeClosed(); + }); + + }); + describe('non-regressions tests', function () { it('issue 231 - closes matches popup on click outside typeahead', function () { From 70af344759f6d62470a47d1dabac711a28036eea Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Tue, 24 Dec 2013 15:53:22 -0800 Subject: [PATCH 0053/1655] chore(test): add test coverage task Run `grunt test:coverage` to see a the test coverage in the terminal. --- Gruntfile.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Gruntfile.js b/Gruntfile.js index 2421eba643..05ae56641f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -135,6 +135,16 @@ module.exports = function(grunt) { travis: { singleRun: true, browsers: ['Firefox'] + }, + coverage: { + singleRun: true, + preprocessors: { + 'src/*/*.js': 'coverage' + }, + reporters: ['progress', 'coverage'], + coverageReporter: { + type : 'text' + } } }, changelog: { @@ -316,11 +326,13 @@ module.exports = function(grunt) { grunt.task.run(['concat', 'uglify']); }); - grunt.registerTask('test', 'Run tests on singleRun karma server', function() { + grunt.registerTask('test', 'Run tests on singleRun karma server', function (subTask) { //this task can be executed in 3 different environments: local, Travis-CI and Jenkins-CI //we need to take settings for each one into account if (process.env.TRAVIS) { grunt.task.run('karma:travis'); + } else if (subTask === 'coverage') { + grunt.task.run('karma:coverage'); } else { grunt.task.run(this.args.length ? 'karma:jenkins' : 'karma:continuous'); } From 81e014a80eede3f5320374e1dee5d9eee3d2e8bf Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Sat, 28 Dec 2013 13:57:10 +0100 Subject: [PATCH 0054/1655] fix(collapse): dont animate height changes from 0 to 0 Closes #1424 --- src/collapse/collapse.js | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/collapse/collapse.js b/src/collapse/collapse.js index 3469d6ad37..05a5b92943 100644 --- a/src/collapse/collapse.js +++ b/src/collapse/collapse.js @@ -45,26 +45,27 @@ angular.module('ui.bootstrap.collapse',['ui.bootstrap.transition']) return currentTransition; }; - var expand = function() { + var expand = function () { + isCollapsed = false; if (initialAnimSkip) { initialAnimSkip = false; - if ( !isCollapsed ) { - fixUpHeight(scope, element, 'auto'); - element.addClass('in'); - } + expandDone(); } else { - doTransition({ height : element[0].scrollHeight + 'px' }) - .then(function() { - // This check ensures that we don't accidentally update the height if the user has closed - // the group while the animation was still running - if ( !isCollapsed ) { - fixUpHeight(scope, element, 'auto'); - element.addClass('in'); - } - }); + var targetElHeight = element[0].scrollHeight; + if (targetElHeight) { + doTransition({ height: targetElHeight + 'px' }).then(expandDone); + } else { + expandDone(); + } } - isCollapsed = false; }; + + function expandDone() { + if ( !isCollapsed ) { + fixUpHeight(scope, element, 'auto'); + element.addClass('in'); + } + } var collapse = function() { isCollapsed = true; From 54e614a8c7a35cc4368c2cb416feaa33d8ed6738 Mon Sep 17 00:00:00 2001 From: Chris Chua Date: Mon, 23 Dec 2013 15:35:48 -0800 Subject: [PATCH 0055/1655] fix(tooltip): respect animate attribute Previously, it was only possible to set animation to false with an empty string and options. Closes #1418 --- src/tooltip/test/tooltip.spec.js | 4 ++++ src/tooltip/tooltip.js | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/tooltip/test/tooltip.spec.js b/src/tooltip/test/tooltip.spec.js index cac92712f2..01f6423fe7 100644 --- a/src/tooltip/test/tooltip.spec.js +++ b/src/tooltip/test/tooltip.spec.js @@ -45,6 +45,10 @@ describe('tooltip', function() { expect( elmScope.tt_isOpen ).toBe( false ); })); + it('should not animate on animation set to false', inject(function() { + expect( elmScope.tt_animation ).toBe( false ); + })); + it('should have default placement of "top"', inject(function() { elm.trigger( 'mouseenter' ); expect( elmScope.tt_placement ).toBe( "top" ); diff --git a/src/tooltip/tooltip.js b/src/tooltip/tooltip.js index 3176f96902..99a9c2bee7 100644 --- a/src/tooltip/tooltip.js +++ b/src/tooltip/tooltip.js @@ -261,10 +261,6 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap scope.tt_placement = angular.isDefined( val ) ? val : options.placement; }); - attrs.$observe(prefix + 'Animation', function (val) { - scope.tt_animation = angular.isDefined(val) ? !!val : options.animation; - }); - attrs.$observe( prefix+'PopupDelay', function ( val ) { var delay = parseInt( val, 10 ); scope.tt_popupDelay = ! isNaN(delay) ? delay : options.popupDelay; @@ -292,6 +288,9 @@ angular.module( 'ui.bootstrap.tooltip', [ 'ui.bootstrap.position', 'ui.bootstrap hasRegisteredTriggers = true; }); + var animation = scope.$eval(attrs[prefix + 'Animation']); + scope.tt_animation = angular.isDefined(animation) ? !!animation : options.animation; + attrs.$observe( prefix+'AppendToBody', function ( val ) { appendToBody = angular.isDefined( val ) ? $parse( val )( scope ) : appendToBody; }); From 9205a57874939b5ca7910689acf47b50dfaf7d0f Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Sat, 28 Dec 2013 20:02:30 +0100 Subject: [PATCH 0056/1655] chore(release): v0.8.0 --- CHANGELOG.md | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 74afde4fd5..4eeda294ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,70 @@ +# 0.8.0 (2013-12-28) + +## Features + +- **datepicker:** + - option whether to display button bar in popup ([4d158e0d](http://github.com/angular-ui/bootstrap/commit/4d158e0d)) +- **modal:** + - add modal-open class to body on modal open ([e76512fa](http://github.com/angular-ui/bootstrap/commit/e76512fa)) +- **progressbar:** + - add `max` attribute & support transclusion ([365573ab](http://github.com/angular-ui/bootstrap/commit/365573ab)) +- **timepicker:** + - default meridian labels based on locale ([8b1ab79a](http://github.com/angular-ui/bootstrap/commit/8b1ab79a)) +- **typeahead:** + - add typeahead-append-to-body option ([dd8eac22](http://github.com/angular-ui/bootstrap/commit/dd8eac22)) + +## Bug Fixes + +- **accordion:** + - correct `is-open` handling for dynamic groups ([9ec21286](http://github.com/angular-ui/bootstrap/commit/9ec21286)) +- **carousel:** + - cancel timer on scope destruction ([5b9d929c](http://github.com/angular-ui/bootstrap/commit/5b9d929c)) + - cancel goNext on scope destruction ([7515df45](http://github.com/angular-ui/bootstrap/commit/7515df45)) +- **collapse:** + - dont animate height changes from 0 to 0 ([81e014a8](http://github.com/angular-ui/bootstrap/commit/81e014a8)) +- **datepicker:** + - set default zero time after no date selected ([93cd0df8](http://github.com/angular-ui/bootstrap/commit/93cd0df8)) + - fire `ngChange` on today/clear button press ([6b1c68fb](http://github.com/angular-ui/bootstrap/commit/6b1c68fb)) + - remove datepicker's popup on scope destroy ([48955d69](http://github.com/angular-ui/bootstrap/commit/48955d69)) + - remove edge case position updates ([1fbcb5d6](http://github.com/angular-ui/bootstrap/commit/1fbcb5d6)) +- **modal:** + - put backdrop in before window ([d64f4a97](http://github.com/angular-ui/bootstrap/commit/d64f4a97)) + - grab reference to body when it is needed in lieu of when the factory is created ([dd415a98](http://github.com/angular-ui/bootstrap/commit/dd415a98)) + - focus freshly opened modal ([709e679c](http://github.com/angular-ui/bootstrap/commit/709e679c)) + - properly animate backdrops on each modal opening ([672a557a](http://github.com/angular-ui/bootstrap/commit/672a557a)) +- **tabs:** + - make nested tabs work ([c9acebbe](http://github.com/angular-ui/bootstrap/commit/c9acebbe)) +- **tooltip:** + - update tooltip content when empty ([60515ae1](http://github.com/angular-ui/bootstrap/commit/60515ae1)) + - support IE8 ([5dd98238](http://github.com/angular-ui/bootstrap/commit/5dd98238)) + - unbind element events on scope destroy ([3fe7aa8c](http://github.com/angular-ui/bootstrap/commit/3fe7aa8c)) + - respect animate attribute ([54e614a8](http://github.com/angular-ui/bootstrap/commit/54e614a8)) + +## Breaking Changes + +- **progressbar:** + The onFull/onEmpty handlers & auto/stacked types have been removed. + + To migrate your code change your markup like below. + + Before: + +```html + +``` + + After: + +```html + +``` + + and for stacked instead of passing array/objects you can do: + +```html + +``` + # 0.7.0 (2013-11-22) ## Features diff --git a/package.json b/package.json index 459732703b..35701722ee 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "https://github.com/angular-ui/bootstrap/graphs/contributors", "name": "angular-ui-bootstrap", - "version": "0.8.0-SNAPSHOT", + "version": "0.8.0", "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", From 3ffe7188a7a86289dd7b456b8eee319f13b3599b Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Sat, 28 Dec 2013 21:15:00 +0100 Subject: [PATCH 0057/1655] chore(release): Starting v0.9.0-SNAPSHOT --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 35701722ee..df8937adcf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "author": "https://github.com/angular-ui/bootstrap/graphs/contributors", "name": "angular-ui-bootstrap", - "version": "0.8.0", + "version": "0.9.0-SNAPSHOT", "dependencies": {}, "devDependencies": { "grunt": "~0.4.1", From a74efa7bc4110c4b3253df33e775b27b485446b0 Mon Sep 17 00:00:00 2001 From: Jon Jaques Date: Mon, 29 Jul 2013 01:16:55 -0500 Subject: [PATCH 0058/1655] demo(all): upgrade project to bs3.0.0-rc2 and get docs looking spiffy --- Gruntfile.js | 13 +++- misc/demo/assets/demo.css | 35 +++++++-- misc/demo/index.html | 155 +++++++++++++++++++------------------- 3 files changed, 114 insertions(+), 89 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 05ae56641f..e8f02b96d9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -4,7 +4,7 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-copy'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-uglify'); grunt.loadNpmTasks('grunt-html2js'); @@ -17,7 +17,8 @@ module.exports = function(grunt) { grunt.initConfig({ ngversion: '1.0.8', - bsversion: '2.3.1', + bsversion: '3.0.2', + faversion: '3.2.1', modules: [],//to be filled in by build task pkg: grunt.file.readJSON('package.json'), dist: 'dist', @@ -29,6 +30,10 @@ module.exports = function(grunt) { all: 'angular.module("ui.bootstrap", ["ui.bootstrap.tpls", <%= srcModules %>]);' }, delta: { + docs: { + files: ['misc/demo/index.html'], + tasks: ['after-test'] + }, html: { files: ['template/**/*.html'], tasks: ['html2js', 'karma:watch:run'] @@ -175,7 +180,7 @@ module.exports = function(grunt) { options: { dest: 'dist/docs', scripts: [ - 'angular.js', + 'angular.js', '<%= concat.dist_tpls.dest %>' ], styles: [ @@ -192,7 +197,7 @@ module.exports = function(grunt) { } }); - //register before and after test tasks so we've don't have to change cli + //register before and after test tasks so we've don't have to change cli //options on the goole's CI server grunt.registerTask('before-test', ['enforce', 'jshint', 'html2js']); grunt.registerTask('after-test', ['build', 'copy']); diff --git a/misc/demo/assets/demo.css b/misc/demo/assets/demo.css index 8a3ee5c909..52f786cb23 100644 --- a/misc/demo/assets/demo.css +++ b/misc/demo/assets/demo.css @@ -86,16 +86,39 @@ section { line-height: 1; } -.icon-github { - background: no-repeat url('http://github.com/github-16px.png'); - width: 16px; - height: 16px; -} -/* Not enough room on mobile for markup tab, js tab, and plunk btn. +/* Not enough room on mobile for markup tab, js tab, and plunk btn. And no one cares about plunk button on a phone anyway */ @media only screen and (max-device-width: 480px) { #plunk-btn { display: none; } +} + +.navbar-nav .dropdown .navbar-brand { + max-width: 100%; + margin-right: inherit; + margin-left: inherit; +} + +.header-placeholder { + height: 175px; +} + +@media screen and (min-width: 768px) { + + .dropdown.open > .navbar-brand + .dropdown-menu { + left: 10px; + } + + .header-placeholder { + height: 50px; + } + + .navbar-nav .dropdown .navbar-brand { + max-width: 200px; + margin-right: 5px; + margin-left: 10px; + } + } \ No newline at end of file diff --git a/misc/demo/index.html b/misc/demo/index.html index 89b3fa0e59..6833d01ab3 100644 --- a/misc/demo/index.html +++ b/misc/demo/index.html @@ -10,51 +10,49 @@ - + + + - -
+
-

@@ -116,15 +114,13 @@

-
- -
- -
-
+
+
+ +

Dependencies

This repository contains a set of native AngularJS directives based on @@ -166,47 +162,48 @@

CSS

- - <% demoModules.forEach(function(module) { %> -
- -
-
- <%= module.docs.html %> -
-
- <%= module.docs.md %> -
-
-
-
-
-
- -
- - -
-
<%- module.docs.html %>
+ <% demoModules.forEach(function(module) { %> +
+
+ +
+
+ <%= module.docs.html %>
- - -
-
<%- module.docs.js %>
+
+ <%= module.docs.md %>
- - -
-
-
- - <% }); %> -
-
+
+
+
+
+
+ +
+ + +
+
<%- module.docs.html %>
+
+
+ +
+
<%- module.docs.js %>
+
+
+
+
+
+
+
+ + <% }); %> +
+