Skip to content

Commit

Permalink
chore(package): Release 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sudo-suhas committed Aug 10, 2017
1 parent 863544d commit deb8f91
Show file tree
Hide file tree
Showing 17 changed files with 2,060 additions and 848 deletions.
2 changes: 1 addition & 1 deletion browser/elastic-builder.min.js

Large diffs are not rendered by default.

428 changes: 293 additions & 135 deletions docs/assets/anchor.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/assets/bass.css
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@
min-height:0;
}
.flex-none{ -webkit-box-flex:0; -webkit-flex:none; -ms-flex:none; flex:none }
.fs0{ flex-shrink: 0 }

.order-0{ -webkit-box-ordinal-group:1; -webkit-order:0; -ms-flex-order:0; order:0 }
.order-1{ -webkit-box-ordinal-group:2; -webkit-order:1; -ms-flex-order:1; order:1 }
Expand Down
Binary file modified docs/assets/fonts/OTF/SourceCodePro-Bold.otf
Binary file not shown.
Binary file modified docs/assets/fonts/OTF/SourceCodePro-Regular.otf
Binary file not shown.
Binary file modified docs/assets/fonts/TTF/SourceCodePro-Bold.ttf
Binary file not shown.
Binary file modified docs/assets/fonts/TTF/SourceCodePro-Regular.ttf
Binary file not shown.
Binary file modified docs/assets/fonts/WOFF/OTF/SourceCodePro-Bold.otf.woff
Binary file not shown.
Binary file modified docs/assets/fonts/WOFF/OTF/SourceCodePro-Regular.otf.woff
Binary file not shown.
Binary file modified docs/assets/fonts/WOFF2/OTF/SourceCodePro-Regular.otf.woff2
Binary file not shown.
Binary file modified docs/assets/fonts/WOFF2/TTF/SourceCodePro-Bold.ttf.woff2
Binary file not shown.
102 changes: 81 additions & 21 deletions docs/assets/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ document.getElementById('filter-input').addEventListener('keyup', function (e) {
}
});

var toggles = document.getElementsByClassName('toggle-step-sibling');
for (var i = 0; i < toggles.length; i++) {
toggles[i].addEventListener('click', toggleStepSibling);
}

function toggleStepSibling() {
var stepSibling = this.parentNode.parentNode.parentNode.getElementsByClassName('toggle-target')[0];
var klass = 'display-none';
if (stepSibling.classList.contains(klass)) {
stepSibling.classList.remove(klass);
stepSibling.innerHTML = '▾';
} else {
stepSibling.classList.add(klass);
stepSibling.innerHTML = '▸';
}
}

var items = document.getElementsByClassName('toggle-sibling');
for (var j = 0; j < items.length; j++) {
items[j].addEventListener('click', toggleSibling);
Expand Down Expand Up @@ -93,11 +76,23 @@ function showHashTarget(targetId) {
}
}

window.addEventListener('hashchange', function () {
function scrollIntoView(targetId) {
// Only scroll to element if we don't have a stored scroll position.
if (targetId && !history.state) {
var hashTarget = document.getElementById(targetId);
if (hashTarget) {
hashTarget.scrollIntoView();
}
}
}

function gotoCurrentTarget() {
showHashTarget(location.hash.substring(1));
});
scrollIntoView(location.hash.substring(1));
}

showHashTarget(location.hash.substring(1));
window.addEventListener('hashchange', gotoCurrentTarget);
gotoCurrentTarget();

var toclinks = document.getElementsByClassName('pre-open');
for (var k = 0; k < toclinks.length; k++) {
Expand All @@ -106,4 +101,69 @@ for (var k = 0; k < toclinks.length; k++) {

function preOpen() {
showHashTarget(this.hash.substring(1));
}
}

var split_left = document.querySelector('#split-left');
var split_right = document.querySelector('#split-right');
var split_parent = split_left.parentNode;
var cw_with_sb = split_left.clientWidth;
split_left.style.overflow = 'hidden';
var cw_without_sb = split_left.clientWidth;
split_left.style.overflow = '';

// Need to add:
// - Half of gutterSize (i.e. 10) because gutter will take that much from each.
// - Scrollbar width (cw_with_sb - cw_without_sb), if it takes up existing
// space (Firefox) rather than adding the scrollbar to the side (Chrome)
var percent_left = (split_left.getBoundingClientRect().width + 10 + cw_without_sb - cw_with_sb) / split_parent.getBoundingClientRect().width * 100;

Split(['#split-left', '#split-right'], {
elementStyle: function (dimension, size, gutterSize) {
return {
'flex-basis': 'calc(' + size + '% - ' + gutterSize + 'px)'
};
},
gutterStyle: function (dimension, gutterSize) {
return {
'flex-basis': gutterSize + 'px'
};
},
gutterSize: 20,
sizes: [percent_left, 100 - percent_left]
});

// Chrome doesn't remember scroll position properly so do it ourselves.
// Also works on Firefox and Edge.

function updateState() {
history.replaceState({
left_top: split_left.scrollTop,
right_top: split_right.scrollTop
}, document.title);
}

function loadState(ev) {
if (ev) {
// Edge doesn't replace change history.state on popstate.
history.replaceState(ev.state, document.title);
}
if (history.state) {
split_left.scrollTop = history.state.left_top;
split_right.scrollTop = history.state.right_top;
}
}

window.addEventListener('load', function () {
// Restore after Firefox scrolls to hash.
setTimeout(function () {
loadState();
// Update with initial scroll position.
updateState();
// Update scroll positions only after we've loaded because Firefox
// emits an initial scroll event with 0.
split_left.addEventListener('scroll', updateState);
split_right.addEventListener('scroll', updateState);
}, 1);
});

window.addEventListener('popstate', loadState);
15 changes: 15 additions & 0 deletions docs/assets/split.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.gutter {
background-color: #f5f5f5;
background-repeat: no-repeat;
background-position: 50%;
}

.gutter.gutter-vertical {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAFAQMAAABo7865AAAABlBMVEVHcEzMzMzyAv2sAAAAAXRSTlMAQObYZgAAABBJREFUeF5jOAMEEAIEEFwAn3kMwcB6I2AAAAAASUVORK5CYII=');
cursor: ns-resize;
}

.gutter.gutter-horizontal {
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
cursor: ew-resize;
}
Loading

0 comments on commit deb8f91

Please sign in to comment.