Skip to content

Commit

Permalink
Bug fix full width.
Browse files Browse the repository at this point in the history
  • Loading branch information
dixso committed Sep 19, 2015
1 parent e50f3d9 commit 55e776d
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions src/js/custombox.js
Original file line number Diff line number Diff line change
@@ -121,18 +121,6 @@
// Listeners.
this.binds();
},
zIndex: function() {
for ( var zIndex = 0, x = 0, elements = document.getElementsByTagName('*'), xLen = elements.length; x < xLen; x += 1 ) {
var val = window.getComputedStyle(elements[x]).getPropertyValue('z-index');
if ( val ) {
val =+ val;
if ( val > zIndex ) {
zIndex = val;
}
}
}
return zIndex;
},
built: function( item ) {
var cb;
if ( typeof this.item !== 'undefined' ) {
@@ -595,6 +583,8 @@
if ( this.cb[i].settings.width !== 'full' ) {
this.cb[i].container.style.marginLeft = '5%';
this.cb[i].container.style.marginRight = '5%';
} else if ( this.cb[i].content.offsetWidth <= window.innerWidth ) {
this.cb[i].content.style.width = 'auto';
}
this.cb[i].container.style.width = 'auto';
this.cb[i].wrapper.style.width = window.innerWidth + 'px';
@@ -620,6 +610,12 @@
this.cb[i].container.style.marginTop = '5%';
this.cb[i].container.style.marginBottom = '5%';
} else {
if ( this.cb[i].settings.width === 'full' ) {
this.cb[i].settings.position[1] = 'top';
if ( this.cb[i].content.offsetHeight <= window.innerHeight ) {
this.cb[i].content.style.height = window.innerHeight + 'px';
}
}
switch ( this.cb[i].settings.position[1].trim() ) {
case 'top':
result = 0;

0 comments on commit 55e776d

Please sign in to comment.