Skip to content

Commit

Permalink
Fix bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
cnjsstong committed Jan 11, 2014
1 parent 490429f commit 0a91acf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
15 changes: 10 additions & 5 deletions angular-panorama.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ angular.module('angular-panorama')
var panorama = iElement.wrap("<div id='" + panoramaId + "' class='ng-panorama-container'></div>"),
container = panorama.parent();

updateContainerHeight();

function updateContainerHeight() {
var minHeight=$window.innerHeight;
if(iAttrs.minHeightOffset) {
minHeight+=iAttrs.minHeightOffset;
}
container.css('min-height',minHeight+'px');
}

if (fakeArray) {
// publish the fakeArray on the scope to be able to add indicators
Expand Down Expand Up @@ -305,11 +314,7 @@ angular.module('angular-panorama')
function resize() {
updateContainerWidth();
updateSlidePosition();
var minHeight=$window.innerHeight;
if(iAttrs.minHeightOffset) {
minHeight+=iAttrs.minHeightOffset;
}
container.css('min-height',minHeight+'px');
updateContainerHeight();
}

function updateContainerWidth() {
Expand Down
Loading

0 comments on commit 0a91acf

Please sign in to comment.