-
-
Save michaeldelorenzo/9376590 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
CRM.module("DashboardApp.Show", function(Show, CRM, Backbone, Marionette, $, _){ | |
Show.Dashboard = Marionette.Layout.extend({ | |
className: "container-fluid", | |
template: "backbone/crm/templates/dashboard/show", | |
regions: { | |
contacts: "#contacts", | |
filter: "#filter" | |
}, | |
origHeight: null, | |
// var CRM.DashboardApp.Show.origHeight = 0, | |
initialize: function(){ | |
console.log(Show.Dashboard) | |
$(window).on('resize', this.updateWindow); | |
this.origHeight = $('#main-region').height(); | |
console.log('Initialized height: '); | |
console.log(this.origHeight); | |
// this.origHeight = function(){ | |
// return origHeight; | |
// }; | |
// this.setOrigHeight = function(value) { | |
// origHeight = value; | |
// } | |
}, | |
updateWindow: function(){ | |
console.log('Original height: '); | |
console.log(this.origHeight); | |
console.log('New region height: ') | |
console.log($('#main-region').height()); | |
var newHeight = $('#main-region').height(); | |
var changeAmt = newHeight - this.origHeight; | |
$('.container-fluid').height($('.container-fluid').height() + changeAmt); | |
$('#display-row').height($('#display-row').height() + changeAmt); | |
console.log('New heights: ') | |
console.log($('#display-row').height()); | |
console.log($('.container-fluid').height()); | |
this.origHeight = newHeight; | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment