Skip to content

Commit

Permalink
Fixed indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
invmatt committed Mar 10, 2014
1 parent 29c47a4 commit 1977fbe
Showing 1 changed file with 131 additions and 131 deletions.
262 changes: 131 additions & 131 deletions src/droplet.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,148 +36,148 @@
'panelPosition': '250'
};

if (settings) { $.extend(config, settings); }
if (settings) { $.extend(config, settings); }

// Set some basic vars
var obj = $(selector);
var child = obj.children('ul');
var childOfChild = obj.children('li > ul');
var menuSize = "";
var i = 0;
var navLocation = (obj).parent();
var animateSpeed = 500;

$("body").addClass("droplet-enabled");

$(function() { windowSize(); });
$(window).resize(windowSize);

function windowSize() {

if ((!config.Modernizr && $(window).width() <= config.smallScreen) || (config.Modernizr && Modernizr.mq('only screen and (max-width : ' + config.smallScreen + 'px)'))) {

if (menuSize != "small") {
menuSize = "small";
$(obj).addClass(config.mode);

// Panel Style
if (!config.panel) {
$(obj).prepend('<div id="' + config.buttonID + '">'+ config.buttonName +'</div>');

$("#" + config.buttonID + "").click(function() {

if ($(child).css('display') == 'none') {
$(child).slideDown("fast");
$("#" + config.buttonID + "").addClass("active");
}

else if ($(child).css('display') == 'block') {
$(child).slideUp("fast");
$("#" + config.buttonID + "").removeClass("active");
}

});

}

if (config.panel) {
$("body").prepend($(obj));
$("body").prepend('<div id="' + config.buttonID + '">Navigation</div>');
$(obj).addClass("panel-closed");

$(obj).css({
width: '' + config.panelPosition + 'px',
left: '-' + config.panelPosition + 'px',
position: "fixed"
});

$("#" + config.buttonID + "").click(function() {

if ($(obj).hasClass('panel-open')) {
$(obj).removeClass('panel-open');
$(obj).addClass('panel-closed');

$(obj).animate({
left: '-' + config.panelPosition + 'px'
}, animateSpeed);

$("body").animate({
left: '0'
}, animateSpeed);

$(child).css("display", "none");
} else {
$(obj).removeClass('panel-closed');
$(obj).addClass('panel-open');

$(obj).animate({
left: '0px'
}, animateSpeed);

$("body").animate({
left: '' + config.panelPosition + 'px'
}, animateSpeed);

$(child).css("display", "block");
}

if (config.subNav) {

if ($(config.subClass).css('display') == 'block') {
$(config.subClass).hide();
}

}

});

}

$(child).css('display', 'none');

if (config.subNav) {

$(config.subClass).before('<div id="droplet-subnav">Section navigation</div>');
$(config.subClass).css("display", "none");

$("#droplet-subnav").click(function() {

$(config.subClass).slideToggle("fast");

if ($(obj).css('display') == 'block') {
$(child).hide();
}

});

}
// Set some basic vars
var obj = $(selector);
var child = obj.children('ul');
var childOfChild = obj.children('li > ul');
var menuSize = "";
var i = 0;
var navLocation = (obj).parent();
var animateSpeed = 500;

}
$("body").addClass("droplet-enabled");

}
$(function() { windowSize(); });
$(window).resize(windowSize);

function windowSize() {

if ((!config.Modernizr && $(window).width() <= config.smallScreen) || (config.Modernizr && Modernizr.mq('only screen and (max-width : ' + config.smallScreen + 'px)'))) {

if (menuSize != "small") {
menuSize = "small";
$(obj).addClass(config.mode);

// Panel Style
if (!config.panel) {
$(obj).prepend('<div id="' + config.buttonID + '">'+ config.buttonName +'</div>');

$("#" + config.buttonID + "").click(function() {

if ($(child).css('display') == 'none') {
$(child).slideDown("fast");
$("#" + config.buttonID + "").addClass("active");
}

else if ($(child).css('display') == 'block') {
$(child).slideUp("fast");
$("#" + config.buttonID + "").removeClass("active");
}

});

}

else if ((!config.Modernizr && $(window).width() >= config.largeScreen) || (config.Modernizr && Modernizr.mq('only screen and (min-width : ' + config.largeScreen + 'px)'))) {
if (menuSize != "large") {
menuSize = "large";
if (config.panel) {
$("body").prepend($(obj));
$("body").prepend('<div id="' + config.buttonID + '">Navigation</div>');
$(obj).addClass("panel-closed");

$(child).css('display', 'block');
$(config.subClass).show();
$(obj).removeClass(config.mode);
$("#" + config.buttonID + ", #droplet-subnav").remove();

if (config.panel) {
$(navLocation).append($(obj));
$(obj).removeAttr('style')
}
$(obj).css({
width: '' + config.panelPosition + 'px',
left: '-' + config.panelPosition + 'px',
position: "fixed"
});

}
$("#" + config.buttonID + "").click(function() {

if ($(obj).hasClass('panel-open')) {
$(obj).removeClass('panel-open');
$(obj).addClass('panel-closed');

$(obj).animate({
left: '-' + config.panelPosition + 'px'
}, animateSpeed);

$("body").animate({
left: '0'
}, animateSpeed);

$(child).css("display", "none");
} else {
$(obj).removeClass('panel-closed');
$(obj).addClass('panel-open');

$(obj).animate({
left: '0px'
}, animateSpeed);

$("body").animate({
left: '' + config.panelPosition + 'px'
}, animateSpeed);

$(child).css("display", "block");
}

if (config.subNav) {

if ($(config.subClass).css('display') == 'block') {
$(config.subClass).hide();
}

}

return this;
};
});

}

$(child).css('display', 'none');

if (config.subNav) {

$(config.subClass).before('<div id="droplet-subnav">Section navigation</div>');
$(config.subClass).css("display", "none");

$("#droplet-subnav").click(function() {

$(config.subClass).slideToggle("fast");

if ($(obj).css('display') == 'block') {
$(child).hide();
}

});

}

}

}


else if ((!config.Modernizr && $(window).width() >= config.largeScreen) || (config.Modernizr && Modernizr.mq('only screen and (min-width : ' + config.largeScreen + 'px)'))) {
if (menuSize != "large") {
menuSize = "large";

$(child).css('display', 'block');
$(config.subClass).show();
$(obj).removeClass(config.mode);
$("#" + config.buttonID + ", #droplet-subnav").remove();

if (config.panel) {
$(navLocation).append($(obj));
$(obj).removeAttr('style')
}

}

}

}

return this;
};

})(jQuery);

0 comments on commit 1977fbe

Please sign in to comment.