Skip to content

Commit

Permalink
Merge branch 'release/2.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
chambaz committed Dec 3, 2013
2 parents 8ff21db + 7caf89d commit af803ad
Show file tree
Hide file tree
Showing 24 changed files with 869 additions and 1,697 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "gumby",
"version": "2.5.15",
"version": "2.6.0",
"main": ["./js/libs/gumby.min.js", "./css/gumby.css"]
}
1,739 changes: 418 additions & 1,321 deletions css/gumby.css

Large diffs are not rendered by default.

17 changes: 15 additions & 2 deletions demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ <h2>A <span>responsive <span>960</span> grid</span>
<p>6 Columns Pull 6</p>
</div>
</div>


<!-- Centering tests -->
<div class="row">
Expand Down Expand Up @@ -1223,8 +1223,21 @@ <h2>A <span>responsive <span>960</span> grid</span>
<script src="js/libs/gumby.init.js"></script>

<!--
Google's recommended deferred loading of JS
gumby.min.js contains gumby.js, all UI modules and gumby.init.js
<script src="js/libs/gumby.min.js"></script> -->
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "js/libs/gumby.min.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script> -->

<script src="js/plugins.js"></script>
<script src="js/main.js"></script>

Expand Down
2 changes: 1 addition & 1 deletion gumby.min.js

Large diffs are not rendered by default.

21 changes: 20 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,27 @@
<script src="js/libs/gumby.init.js"></script>

<!--
Google's recommended deferred loading of JS
gumby.min.js contains gumby.js, all UI modules and gumby.init.js
<script src="js/libs/gumby.min.js"></script> -->
Note: If you opt to use this method of defered loading,
ensure that any javascript essential to the initial
display of the page is included separately in a normal
script tag.
<script type="text/javascript">
function downloadJSAtOnload() {
var element = document.createElement("script");
element.src = "js/libs/gumby.min.js";
document.body.appendChild(element);
}
if (window.addEventListener)
window.addEventListener("load", downloadJSAtOnload, false);
else if (window.attachEvent)
window.attachEvent("onload", downloadJSAtOnload);
else window.onload = downloadJSAtOnload;
</script> -->

<script src="js/plugins.js"></script>
<script src="js/main.js"></script>

Expand Down
25 changes: 16 additions & 9 deletions js/libs/ui/gumby.fixed.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@

this.$el = $el;

this.$window = $(window);
this.fixedPoint = '';
this.pinPoint = false;
this.fixedPointjQ = false;
this.pinPointjQ = false;
this.offset = 0;
this.pinOffset = 0;
this.top = 0;
Expand All @@ -29,7 +32,7 @@
var scope = this;

// monitor scroll and update fixed elements accordingly
$(window).on('scroll load', function() {
this.$window.on('scroll load', function() {
scope.monitorScroll();
});

Expand Down Expand Up @@ -75,12 +78,15 @@
this.pinPoint = this.parseAttrValue(this.pinPoint);
}

this.fixedPointjQ = this.fixedPoint instanceof jQuery;
this.pinPointjQ = this.pinPoint instanceof jQuery;

// if we have a parent constrain dimenions
if(this.$parent && this.constrainEl) {
// measure up
this.measure();
// and on resize reset measurement
$(window).resize(function() {
this.$window.resize(function() {
if(scope.state) {
scope.measure();
scope.constrain();
Expand All @@ -91,14 +97,15 @@

// monitor scroll and trigger changes based on position
Fixed.prototype.monitorScroll = function() {
var scrollAmount = $(window).scrollTop(),
var scrollAmount = this.$window.scrollTop(),
// recalculate selector attributes as position may have changed
fixedPoint = this.fixedPoint instanceof jQuery ? this.fixedPoint.offset().top : this.fixedPoint,
pinPoint = false;
fixedPoint = this.fixedPointjQ ? this.fixedPoint.offset().top : this.fixedPoint,
pinPoint = false,
timer;

// if a pin point is set recalculate
if(this.pinPoint) {
pinPoint = this.pinPoint instanceof jQuery ? this.pinPoint.offset().top : this.pinPoint;
pinPoint = this.pinPointjQ ? this.pinPoint.offset().top : this.pinPoint;
}

// apply offsets
Expand Down Expand Up @@ -127,7 +134,7 @@

this.state = 'fixed';
this.$el.css({
'top' : 0 + this.top
'top' : this.top
}).addClass('fixed').removeClass('unfixed pinned').trigger('gumby.onFixed');

// if we have a parent constrain dimenions
Expand Down Expand Up @@ -166,9 +173,9 @@

// measure up the parent for constraining
Fixed.prototype.measure = function() {
var offsets = this.$parent.offset(), parentPadding;
var parentPadding;

this.measurements.left = offsets.left;
this.measurements.left = this.$parent.offset().left;
this.measurements.width = this.$parent.width();

// if element has a parent row then need to consider padding
Expand Down
11 changes: 11 additions & 0 deletions js/libs/ui/gumby.navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
this.$dropDowns = this.$el.find('li:has(.dropdown)');
var scope = this;

var persist = this.$el.attr('gumby-persist');
if(typeof persist === 'undefined' && persist !== 'false') {
this.$el.find('li:not(:has(.dropdown)) a').on(Gumby.click, function() {
scope.$el.find('ul').removeClass('active');
});
}

// when navbar items
this.$dropDowns
// are tapped hide/show dropdowns
Expand All @@ -40,6 +47,10 @@
Navbar.prototype.toggleDropdown = function(e) {
e.preventDefault();

if($(e.target).is('i')) {
return;
}

var $this = $(this);

if($this.hasClass('active')) {
Expand Down
9 changes: 4 additions & 5 deletions sass/_base.scss
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
@import "compass/typography/vertical_rhythm";
/* Base Styles */

@import "compass/typography/vertical_rhythm";
@include establish-baseline;

* {
@include box-sizing(border-box);
}
* { @include box-sizing(border-box); }

body {
background: $global-bg-color;
Expand All @@ -13,6 +12,7 @@ body {
color: $body-font-color;
position: relative;
-webkit-font-smoothing: $font-smoothing;
-moz-osx-font-smoothing: grayscale;
@include respond(all-phones) {
-webkit-text-size-adjust: none;
-ms-text-size-adjust: none;
Expand Down Expand Up @@ -43,7 +43,6 @@ html, body {
.text-center { @extend %text-center; }
.text-left { @extend %text-left; }
.text-right { @extend %text-right; }

// Partial to align Text Left or Right
%text-center { text-align: center; }
%text-left { text-align: left; }
Expand Down
Loading

0 comments on commit af803ad

Please sign in to comment.