Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 8448f96

Browse files
committed
refactor(tabs): simpler code, focus fixes
1 parent 5a62764 commit 8448f96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1159
-2461
lines changed

config/build.config.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ module.exports = {
2727
return !!module;
2828
}),
2929

30-
componentsModule: "angular.module('ngMaterial', [ 'ng', 'ngAnimate', 'material.services.attrBind', 'material.services.compiler', 'material.services.registry', 'material.services.throttle', 'material.decorators', 'material.services.aria', <%= components.join(',') %>]);\n",
30+
componentsModule: "angular.module('ngMaterial', [ 'ng', 'ngAnimate', 'material.services.attrBind', 'material.services.compiler', 'material.services.registry', 'material.decorators', 'material.services.aria', <%= components.join(',') %>]);\n",
3131

3232
dist: 'dist',
3333

@@ -64,9 +64,8 @@ module.exports = {
6464
//into the build
6565
js: [
6666
//Utilities
67-
'src/base/iterator.js',
68-
'src/base/utils.js',
69-
'src/base/constants.js',
67+
'src/core/**/*.js',
68+
'!src/core/**/*.spec.js',
7069

7170
// Ink Components
7271
'src/components/animate/effects.js',

docs/app/js/demoInclude.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,7 @@ function($q, $http, $compile, $templateCache) {
5858
.then(function(response) { return response.data; });
5959
}))
6060
.then(function(styles) {
61-
styles = styles
62-
.join('\n') //join styles as one string
63-
.replace(/.+?({|,)\w*$/g, function($1) {
64-
// change ' .selector {' to '.buttonsDemo1 .selector {'
65-
return demoSelector + $1;
66-
});
61+
styles = styles.join('\n'); //join styles as one string
6762

6863
var styleElement = angular.element('<style>' + styles + '</style>');
6964
document.body.appendChild(styleElement[0]);

docs/app/js/highlight-angular.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ DocsApp
1919
if (attr.code) {
2020
code = scope.$eval(attr.code);
2121
}
22+
if (!code) return;
2223
var highlightedCode = hljs.highlight(attr.language || attr.lang, code.trim());
2324
highlightedCode.value = highlightedCode.value.replace(/=<span class="hljs-value">""<\/span>/gi, '');
2425
codeElement.append(highlightedCode.value).addClass('highlight');

docs/processors/components-generate.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var _ = require('lodash');
22
var path = require('canonical-path');
33
var ngModuleData = require('../util/ngModuleData');
4+
var sass = require('node-sass');
45

56
module.exports = {
67
name: 'components-generate',
@@ -107,14 +108,26 @@ module.exports = {
107108
.remove({ basePath: 'index.html' })
108109
.first();
109110

110-
var moduleDoc = _.find(demoDocs, function(doc) {
111-
return !!doc.module;
112-
});
111+
var moduleDoc = _.find(demoDocs, function(doc) {
112+
return !!doc.module;
113+
});
113114

114115
demo.module = moduleDoc && moduleDoc.module || '';
115116
var files = _.map(demoDocs, generateDemoFile);
116117
var indexFile = generateDemoFile(indexDoc);
117118

119+
// Wrap the css docs in a '.demoModule {' rule and compile with sass.
120+
if (demo.module) {
121+
_.filter(files, { fileType: 'css' })
122+
.forEach(function(file) {
123+
var moduleSelector = '.' + demo.module + ' {';
124+
var content = moduleSelector + '\n' + file.content + '\n}';
125+
file.content = sass.renderSync({
126+
data: content
127+
});
128+
});
129+
}
130+
118131
renderedDocs = renderedDocs
119132
.concat(indexFile)
120133
.concat(files);

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"karma-safari-launcher": "^0.1.1",
3838
"karma-sauce-launcher": "^0.2.10",
3939
"lodash": "^2.4.1",
40-
"minimist": "^0.1.0"
40+
"minimist": "^0.1.0",
41+
"node-sass": "^0.9.5-rc1"
4142
}
4243
}

src/base/constants.js

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/base/iterator.js

Lines changed: 0 additions & 236 deletions
This file was deleted.

0 commit comments

Comments
 (0)