Switch to using javascript widgets using site styling

- Quickstart selector is implemented using bootstrap-select rather than the dropdown button used elsewhere
- Quickstart selector is still to be styled
This commit is contained in:
Kurtis Seebaldt and Nick Street
2013-08-14 15:42:35 +01:00
parent 6307a2bf04
commit 04efbcf66f
9 changed files with 918 additions and 62 deletions
+4 -21
View File
@@ -12,24 +12,10 @@ $(function(){
return this;
};
//OPENS ITEM DROPDOWN WIDGET
$(".js-item--open-dropdown").click(function () {
var dropdownItem = $(this).parents(".js-item-dropdown--wrapper");
var documentHeight = $(document).height();
var headerHeight = $("header").outerHeight();
var footerHeight = $("footer").outerHeight();
var scrimHeight = documentHeight - headerHeight - footerHeight;
dropdownItem.toggleClass("js-open");
dropdownItem.siblings().removeClass("js-open");
$(this).parents(".js-item-dropdown-widget--wrapper").siblings().find(".js-item-dropdown--wrapper").removeClass("js-open");
$("#scrim").addClass("js-show").css("height", scrimHeight).css("top", headerHeight);
$("#scrim").click(function() {
$(".js-item-dropdown--wrapper").removeClass("js-open");
$(this).removeClass("js-show");
});
$("#scrim").click(function() {
$(".js-item-dropdown--wrapper").removeClass("js-open");
$(".js-item--open-dropdown").removeClass("js-show");
$("#scrim").removeClass("js-show");
});
//OPENS SEARCH DROPDOWN
@@ -48,7 +34,6 @@ $(function(){
$(".body--container, .js-search-input-close").click(function() {
inputContainer.removeClass("js-show");
$(".nav-search").removeClass("js-highlight");
$("#scrim").removeClass("js-show");
});
});
@@ -112,8 +97,6 @@ $(function(){
});
var detectOs = function() {
if (navigator.appVersion.indexOf("Win")!=-1) return "Windows";
if (navigator.appVersion.indexOf("Mac")!=-1) return "Mac";
+4 -3
View File
@@ -46,11 +46,11 @@ Spring.Release = function(data) {
Spring.Release.prototype = {
statusIconClass: function() {
if (this.preRelease) {
return "icon-projects-pre";
return "icon-pre-release";
} else if (this.current) {
return "icon-projects-current";
return "icon-current-version";
} else {
return "icon-projects-supported";
return "icon-supported-version";
}
}
}
@@ -95,6 +95,7 @@ Spring.QuickStartSelectorView = Backbone.View.extend({
this.$el.html(
this.template(this.model)
);
this.$('.selectpicker').selectpicker();
return this;
},
+3 -3
View File
@@ -35,9 +35,9 @@ describe("Project", function () {
});
it("has a statusIconClass", function() {
expect(releases[0].statusIconClass()).toEqual("icon-projects-pre");
expect(releases[1].statusIconClass()).toEqual("icon-projects-current");
expect(releases[2].statusIconClass()).toEqual("icon-projects-supported");
expect(releases[0].statusIconClass()).toEqual("icon-pre-release");
expect(releases[1].statusIconClass()).toEqual("icon-current-version");
expect(releases[2].statusIconClass()).toEqual("icon-supported-version");
});
});
});