Browse Source

toggle platforms works. kinda hacky tho

pull/249/head
connors 11 years ago
parent
commit
05860a1140
  1. 8
      components.html
  2. 24
      docs-assets/js/docs.js

8
components.html

@ -15,7 +15,7 @@ base_url: "../"
<div class="column units-2">
<a class="icon icon-list" href="#"></a>
<a class="icon icon-download" href="#"></a>
<h1 class="logotype">R</h1>
<!-- <h1 class="logotype">R</h1> -->
<h2 class="section-title">Components</h2>
<p class="section-description">Design patterns that serve as basic building blocks</p>
</div>
@ -24,13 +24,13 @@ base_url: "../"
<div class="platform-toggle">
<ul class="segmented-controller">
<li class="selected" data-platform="">
<li class="platform-switch selected" data-platform="">
<a>Base</a>
</li>
<li data-platform="platform-ios">
<li class="platform-switch" data-platform="platform-ios">
<a>iOS</a>
</li>
<li data-platform="platform-android">
<li class="platform-switch" data-platform="platform-android">
<a>Android</a>
</li>
</ul>

24
docs-assets/js/docs.js

@ -65,6 +65,27 @@ $(function() {
componentsList.removeClass('active');
})
// Platform switcher
$('.platform-switch').on('click', function () {
var components = $('.docs-components');
var platform = $(this).attr('data-platform');
// Set platform
if (components.hasClass('platform-ios')) {
components.removeClass('platform-ios');
components.addClass(platform);
} else if (components.hasClass('platform-android')) {
components.removeClass('platform-android');
components.addClass(platform);
} else {
components.addClass(platform);
}
// Deal with selected states
$(this).siblings('.selected').removeClass('selected');
$(this).addClass('selected');
});
win.on('scroll', calculateScroll);
}
@ -127,9 +148,6 @@ $(function() {
}
}
$(window).on('load resize', initialize);
$(window).on('load', function () { new FingerBlast('.device-content'); });
$(window).on('load', function () { new FingerBlast('.platform-toggle'); });
});

Loading…
Cancel
Save