Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
fix: modify CSS loaded for modules with dependencies
Browse files Browse the repository at this point in the history
- Modify loading of CSS to be purely in the index.js files for modules that depend on other modules with CSS files

Closes #5698
  • Loading branch information
Wei Wang authored and wesleycho committed Mar 27, 2016
1 parent e50f602 commit 8074899
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 23 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ If you would prefer not to load your css through your JavaScript file loader/bun
* carousel
* datepicker
* datepickerPopup
* dropdown
* popover
* position
* timepicker
* tooltip
Expand Down
4 changes: 2 additions & 2 deletions src/datepickerPopup/index-nocss.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('../datepicker');
require('../position');
require('../datepicker/index-nocss.js');
require('../position/index-nocss.js');
require('../../template/datepickerPopup/popup.html.js');

var MODULE_NAME = 'ui.bootstrap.module.datepickerPopup';
Expand Down
2 changes: 2 additions & 0 deletions src/datepickerPopup/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
require('../datepicker/datepicker.css');
require('../position/position.css');
require('./popup.css');
module.exports = require('./index-nocss.js');
8 changes: 8 additions & 0 deletions src/dropdown/index-nocss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require('../position/index-nocss.js');
require('./dropdown');

var MODULE_NAME = 'ui.bootstrap.module.dropdown';

angular.module(MODULE_NAME, ['ui.bootstrap.dropdown']);

module.exports = MODULE_NAME;
10 changes: 2 additions & 8 deletions src/dropdown/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
require('../position');
require('./dropdown');

var MODULE_NAME = 'ui.bootstrap.module.dropdown';

angular.module(MODULE_NAME, ['ui.bootstrap.dropdown']);

module.exports = MODULE_NAME;
require('../position/position.css');
module.exports = require('./index-nocss.js');
11 changes: 11 additions & 0 deletions src/popover/index-nocss.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require('../tooltip/index-nocss.js');
require('../../template/popover/popover.html.js');
require('../../template/popover/popover-html.html.js');
require('../../template/popover/popover-template.html.js');
require('./popover');

var MODULE_NAME = 'ui.bootstrap.module.popover';

angular.module(MODULE_NAME, ['ui.bootstrap.popover', 'uib/template/popover/popover.html', 'uib/template/popover/popover-html.html', 'uib/template/popover/popover-template.html']);

module.exports = MODULE_NAME;
13 changes: 2 additions & 11 deletions src/popover/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
require('../tooltip');
require('../../template/popover/popover.html.js');
require('../../template/popover/popover-html.html.js');
require('../../template/popover/popover-template.html.js');
require('./popover');

var MODULE_NAME = 'ui.bootstrap.module.popover';

angular.module(MODULE_NAME, ['ui.bootstrap.popover', 'uib/template/popover/popover.html', 'uib/template/popover/popover-html.html', 'uib/template/popover/popover-template.html']);

module.exports = MODULE_NAME;
require('../tooltip/tooltip.css');
module.exports = require('./index-nocss.js');
2 changes: 1 addition & 1 deletion src/tooltip/index-nocss.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require('../position');
require('../position/index-nocss.js');
require('../stackedMap');
require('../../template/tooltip/tooltip-popup.html.js');
require('../../template/tooltip/tooltip-html-popup.html.js');
Expand Down
1 change: 1 addition & 0 deletions src/tooltip/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require('../position/position.css');
require('./tooltip.css');
module.exports = require('./index-nocss.js');
2 changes: 1 addition & 1 deletion src/typeahead/index-nocss.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require('../debounce');
require('../position');
require('../position/index-nocss.js');
require('../../template/typeahead/typeahead-match.html.js');
require('../../template/typeahead/typeahead-popup.html.js');
require('./typeahead');
Expand Down
1 change: 1 addition & 0 deletions src/typeahead/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
require('../position/position.css');
require('./typeahead.css');
module.exports = require('./index-nocss.js');

0 comments on commit 8074899

Please sign in to comment.