Skip to content

Commit

Permalink
fix busted width on grid toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
mattheu committed Mar 28, 2015
1 parent 025ed4d commit b518462
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions includes/plugins/grid/grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

?>

<!-- <div id="grid-overlay-toggle" style="position: fixed; top: 10px; right: 10px; ">
<button id="tpp-grid-overlay-on" style="display: none;" class="btn">Show Grid</button>
<button id="tpp-grid-overlay-off" style="display: none;" class="btn">Hide Grid</button>
</div> -->

<div id="grid-overlay" style="display:none;">
<div class="wrap">
<div class="row show-grid">
Expand All @@ -26,12 +21,12 @@
</div>

<script type="text/javascript" >

var mphGridOverlay = {

overlay : document.getElementById('grid-overlay'),
button : document.createElement('a'),

buttonTextOff : 'Show Grid',
buttonTextOn : 'Hide Grid',

Expand All @@ -49,15 +44,15 @@
button.appendChild( document.createTextNode( this.buttonTextOff ) );
li.appendChild( button );
adminBarContainer.appendChild( li );
li.style.width = button.offsetWidth + 'px';

},

toggleDisplay : function(e,el) {
e.preventDefault();
this.overlay.style.display = ( this.overlay.style.display === 'block' ) ? 'none' : 'block';
this.button.innerHTML = '';
this.button.appendChild(
document.createTextNode( ( this.overlay.style.display === 'block' ) ? this.buttonTextOff : this.buttonTextOn )
this.button.appendChild(
document.createTextNode( ( this.overlay.style.display === 'block' ) ? this.buttonTextOff : this.buttonTextOn )
);
},

Expand Down Expand Up @@ -86,12 +81,12 @@
},

init : function() {

var self = this;
self.overlay.style.display = 'none';
self.insertButton();
self.button.addEventListener( 'click', function(e) { self.toggleDisplay.call( self, e, this ) } );

this.baselineFillRows();
}

Expand All @@ -102,7 +97,7 @@
mphGridOverlay.init();

} );


// new function() {

Expand Down

0 comments on commit b518462

Please sign in to comment.