Skip to content

Commit 849a987

Browse files
authored
Merge pull request #394 from canjs/fix/3100/ie-design-bugs
Fix IE 9 & 10 design bugs
2 parents b733daf + 3a0ef1c commit 849a987

File tree

13 files changed

+68
-29
lines changed

13 files changed

+68
-29
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ doc/
44
index.html
55
.vscode
66
*.log
7-
.DS_Store
7+
.DS_Store
8+
npm-debug.log

bit-docs.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,18 @@ module.exports = function(bitDocs){
99
bitDocs.register("html", {
1010
templates: path.join(__dirname, "templates"),
1111
dependencies: dependencies,
12-
staticDist: path.join(__dirname, "dist", "static")
12+
staticDist: path.join(__dirname, "dist", "static"),
13+
package: {
14+
steal: {
15+
configDependencies: [
16+
"./node_modules/steal-conditional/conditional"
17+
]
18+
},
19+
devDependencies: {
20+
"flexibility": "^2.0.1"
21+
}
22+
}
1323
});
1424

1525
bitDocs.register("tags", tags);
16-
}
26+
};

build-search-worker.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var dest = siteConfig.dest + '/static/search-worker.js';
1414

1515
fs.mkdir(siteConfig.dest, function() {
1616
stealTools.export({
17-
system: {
17+
steal: {
1818
config: __dirname + '/package.json!npm',
1919
main: 'static/search-worker'
2020
},

make-example.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,24 @@ var docMap = readFile(__dirname+"/docMap.json").then(function(source){
1313
var siteConfig = {
1414
html: {
1515
templates: path.join(__dirname, "templates"),
16+
package: {
17+
steal: {
18+
configDependencies: [
19+
"./node_modules/steal-conditional/conditional"
20+
]
21+
},
22+
devDependencies: {
23+
"flexibility": "^2.0.1"
24+
}
25+
},
1626
dependencies: {
1727
"bit-docs-html-canjs": __dirname,
1828
"bit-docs-prettify": "^0.1.0",
19-
"bit-docs-html-highlight-line": "^0.2.2",
20-
//TODO: This should not be include here and should only be included in package.json.
21-
// we get an error without this, here, though
22-
"steal-stache": "^3.0.1"
29+
"bit-docs-html-highlight-line": "^0.2.2",
30+
//TODO: This should not be include here and should only be included in package.json.
31+
// we get an error without this, here, though
32+
"steal-stache": "^3.0.1",
33+
"steal-conditional": "^0.3.6"
2334
},
2435
staticDist: [
2536
path.join(__dirname, "dist", "static")

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,26 +30,28 @@
3030
"url": "https://github.com/canjs/bit-docs-html-canjs/issues"
3131
},
3232
"homepage": "https://github.com/canjs/bit-docs-html-canjs#readme",
33-
"system": {},
3433
"dependencies": {
3534
"can-control": "^3.0.3",
3635
"can-util": "^3.0.10",
3736
"escape-html": "^1.0.3",
37+
"flexibility": "^2.0.1",
3838
"jquery": "^3.1.1",
3939
"lodash": "^4.17.4",
4040
"lunr": "bit-docs/lunr.js#279-safari-exception",
4141
"steal-stache": "^3.0.1",
4242
"unescape-html": "^1.0.0"
4343
},
4444
"devDependencies": {
45-
"bit-docs-generate-html": "^0.7.0",
45+
"bit-docs-generate-html": "^0.8.0",
4646
"bit-docs-generate-searchmap": "^0.1.3",
4747
"bit-docs-html-toc": "^0.6.0",
4848
"connect": "^3.5.0",
4949
"normalize.css": "^5.0.0",
5050
"q": "^1.4.1",
51-
"steal": "^0.16.44",
52-
"steal-qunit": "^0.1.4",
51+
"steal": "^1.5.9",
52+
"steal-conditional": "^0.3.6",
53+
"steal-qunit": "^1.0.1",
54+
"steal-tools": "^1.8.2",
5355
"testee": "^0.7.0",
5456
"zombie": "^5.0.5"
5557
}

static/canjs.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require("flexibility#?./needs-flexibility");
12
require("./canjs.less!");
23
var LoadingBar = require('./loading-bar.js');
34
$ = require("jquery");
@@ -30,6 +31,11 @@ var $articleContainer,
3031
hasShownSearch = false;
3132
init();
3233

34+
// flexbox for ie9/10
35+
if(typeof flexibility !== 'undefined'){
36+
flexibility(document.getElementById('everything'));
37+
}
38+
3339
// prevent sidebar from changing width when header hides
3440
$('#left').css('min-width', $('.top-left').width());
3541

@@ -219,7 +225,7 @@ function navigate(href, updateLocation) {
219225
},
220226
success: function(content) {
221227

222-
if(updateLocation !== false){
228+
if(window.history.pushState && updateLocation !== false){
223229
window.history.pushState(null, null, href);
224230
}
225231

@@ -279,7 +285,7 @@ function navigate(href, updateLocation) {
279285
}
280286
},
281287
error: function() {
282-
if(updateLocation !== false){
288+
if(window.history.pushState && updateLocation !== false){
283289
window.history.pushState(null, null, href);
284290
}
285291
// just reload the page if this fails

static/canjs.less

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*---------- UTILITIES ----------*/
2-
@import "/node_modules/normalize.css/normalize.css";
2+
@import "locate://normalize.css/normalize.css";
33
@import "variables.less";
44
@import "mixins.less";
55

static/header.less

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
.top-right-top {
2-
display: inline-flex;
3-
flex-direction: row-reverse;
4-
height: @brand-height;
5-
width: 100%;
6-
justify-content: space-between;
2+
.flex;
3+
flex-direction: row-reverse;
4+
-ms-flex-direction: row-reverse;
5+
flex-shrink: 0;
6+
height: @brand-height;
7+
justify-content: space-between;
78
}
8-
99
.brand {
1010
height: @brand-height;
1111
padding-top: @gutter;
1212
background: white;
13-
1413
.dropdown {
1514
display:none;
1615
}
@@ -112,7 +111,6 @@
112111
.top-right-links {
113112
display: none;
114113
@media screen and (min-width: @breakpoint){
115-
display: flex;
116114
.flex;
117115
list-style: none;
118116
margin: @gutter @gutter*2;
@@ -121,6 +119,7 @@
121119
flex-basis: 100%;
122120
align-self: flex-start;
123121
> li {
122+
.flex;
124123
font-size: 14px;
125124
margin-right: @gutter;
126125
> a {

static/layout.less

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
-webkit-overflow-scrolling: touch
1010
}
1111
#left {
12+
-ms-flex-wrap: wrap;
1213
position: fixed;
1314
width: @sidebar-width;
1415
min-width: 0;
@@ -25,6 +26,7 @@
2526
}
2627
}
2728
#right {
29+
-ms-flex-wrap: wrap;
2830
height: 100%;
2931
min-height: 100%;
3032
max-height: 100%;
@@ -53,13 +55,15 @@
5355

5456
@media screen and (min-width: @breakpoint){
5557
.top-left {
58+
width: 100%;
5659
height: auto;
5760
}
5861
}
5962
.top-right {
6063
flex-shrink: 0;
6164
flex-wrap: nowrap;
6265
height: auto;
66+
width: 100%;
6367
.border-bottom;
6468
@media screen and (min-width: @breakpoint){
6569
border: none;

static/mixins.less

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
.border {
1414
border: 1px solid @border-color;
1515
}
16-
.flex {
16+
.flex {
17+
-js-display: flex; // ie9/10 flexbox fix
1718
display: -webkit-box;
1819
display: -moz-box;
1920
display: -ms-flexbox;
@@ -36,7 +37,7 @@
3637
font-size: .9em;
3738
color: @code-color;
3839
}
39-
.transition-left {
40+
.transition-left {
4041
-webkit-transition: left .5s ;
4142
-moz-transition: left .5s;
4243
-o-transition: left .5s;
@@ -114,4 +115,4 @@
114115
top: 8px;
115116
margin-right: 5px;
116117
}
117-
}
118+
}

0 commit comments

Comments
 (0)