Skip to content

Commit

Permalink
Merge pull request tessel#32 from flaki/gh-pages
Browse files Browse the repository at this point in the history
fix install tabs (fixes tessel#12)
  • Loading branch information
Frijol committed Sep 6, 2015
2 parents 3b9eb35 + 0b9140e commit d67e1c1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 17 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% capture include_install %}
{% include_relative install.md %}
{% endcapture %}
{{ include_install | markdownify }}
{{ include_install | markdownify | replace: '<p>|','<dd>' | replace: '|</p>','</dd>' | replace: '||','</dd><dd>' }}

<div class="large-12 columns">
<div class="row">
Expand Down
12 changes: 2 additions & 10 deletions install.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,7 @@
Select the operating system you are working on.

<dl id="install-tabs" data-tab="" class="tabs contained three-up">
<dd class="active">
[OSX](#tab-osx)
</dd>
<dd>
[Linux](#tab-linux)
</dd>
<dd>
[Windows](#tab-pc)
</dd>
| [OSX](#tab-osx) || [Linux](#tab-linux) || [Windows](#tab-windows) |
</dl>

<div id="install-content" class="tabs-content">
Expand Down Expand Up @@ -48,7 +40,7 @@ npm install -g t2-cli

</div>

<div id="tab-pc" class="content">
<div id="tab-windows" class="content">

On Windows, Tessel drivers will install automatically when you plug in.

Expand Down
12 changes: 6 additions & 6 deletions javascripts/custom/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ $(function () {
var isWindows = navigator.platform.toUpperCase().indexOf('WIN')!==-1;
var isLinux = navigator.platform.toUpperCase().indexOf('LINUX')!==-1;

isMac && $('#osx-tab').trigger('click');
isWindows && $('#pc-tab').trigger('click');
isLinux && $('#linux-tab').trigger('click');
isMac && $('[href="#tab-osx"]').trigger('click');
isWindows && $('[href="#tab-windows"]').trigger('click');
isLinux && $('[href="#tab-linux"]').trigger('click');

// show based on window hash
var hash = window.location.hash;
if (hash) {
hash = hash.substring(hash.indexOf('#')+1).toLowerCase();
hash = hash.substring(hash.indexOf('#')+5).toLowerCase();
if (['osx', 'linux', 'windows'].indexOf(hash) != -1){
$('#'+hash+'-tab').trigger("click");
$('[href="#tab-'+hash+'"]').trigger("click");
foundOS = true;
}
}
Expand Down Expand Up @@ -68,4 +68,4 @@ $(function () {
anchor.append(tempContent);
}
}
})
});

0 comments on commit d67e1c1

Please sign in to comment.