Created
June 17, 2014 19:26
-
-
Save nucleardreamer/bc3f737f8b0f9c15e3ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(D) { | |
/** | |
* Constructor | |
*/ | |
var VariableHeightLayoutManager = function(){} | |
// Shorthand prototype storage (might trim down code for many functions) | |
var fn = VariableHeightLayoutManager.prototype; | |
fn.numColumns = 6; | |
fn.childrenArray = []; | |
// Add grid listeners | |
fn.addListeners = function () { | |
// Make instance of "this" for use inside functions | |
var _self = this; | |
// Listen for a change in the body columns (triggered from Browser.js) | |
$(window).on('onBodyColumnsChanged', D.debounce(_self.onResize, 50)); | |
}; | |
// Build and update the grid on resize | |
fn.onResize = function () { | |
var _self = this; | |
_self.childrenArray = _.map(new Array(_self.numColumns), function(){ return 0 }) | |
}; | |
// Public Release to Dspn object | |
// ----------------------------- | |
D.layoutManager = VariableHeightLayoutManager; | |
}(Dspn)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment