Skip to content

Commit

Permalink
Updated showSpacingValue to hideSpacingValue πŸ‘©β€πŸ’»
Browse files Browse the repository at this point in the history
  • Loading branch information
actuallyakash committed Jun 15, 2021
1 parent fb525aa commit 5103568
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ <h2 class="text-center text-md-left">
<a class="nav-link" href="#appendHtml">appendHtml</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#showSpacingValue">showSpacingValue</a>
<a class="nav-link" href="#hideSpacingValue">hideSpacingValue</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#showLabel">showLabel</a>
Expand Down Expand Up @@ -495,28 +495,28 @@ <h2 class="docs-title">appendHtml</h2>
<p>To append spacer divs after or before the specified <code class="language-js">element</code>. Use <code>begin</code> to before the selector and <code>end</code> to append after the selector.</p> Check in the developer tools.
</div>

<div class="docs-section" id="showSpacingValue">
<h2 class="docs-title">showSpacingValue</h2>
<div class="docs-section" id="hideSpacingValue">
<h2 class="docs-title">hideSpacingValue</h2>

<div class="row mb-3">
<div class="element col-6 col-md-4">
<div class="element-block showSpacingValue-prop">
<div class="element-block hideSpacingValue-prop">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eius, eveniet laudantium, sit soluta ipsum
reprehenderit libero eaque ex, unde nesciunt blanditiis itaque nemo exercitationem voluptates modi
et cumque quas. Aliquid.
</div>
</div>

<div class="element col-6 col-md-4">
<div class="element-block showSpacingValue-prop">
<div class="element-block hideSpacingValue-prop">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eius, eveniet laudantium, sit soluta ipsum
reprehenderit libero eaque ex, unde nesciunt blanditiis itaque nemo exercitationem voluptates modi
et cumque quas. Aliquid.
</div>
</div>

<div class="element col-6 col-md-4">
<div class="element-block showSpacingValue-prop">
<div class="element-block hideSpacingValue-prop">
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Eius, eveniet laudantium, sit soluta ipsum
reprehenderit libero eaque ex, unde nesciunt blanditiis itaque nemo exercitationem voluptates modi
et cumque quas. Aliquid.
Expand All @@ -527,12 +527,12 @@ <h2 class="docs-title">showSpacingValue</h2>
<pre>
<code class="language-js">
spacers({
element: '.showSpacingValue-prop',
showSpacingValue: true
element: '.hideSpacingValue-prop',
hideSpacingValue: true
});
</code>
</pre>
<p>Show the margin/padding values at the center of the spacer</p>
<p>Hides the margin/padding values at the center of the spacer</p>
</div>

<div class="docs-section" id="showLabel">
Expand Down
4 changes: 2 additions & 2 deletions docs/js/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ spacers({
});

spacers({
element: '.showSpacingValue-prop',
showSpacingValue: false
element: '.hideSpacingValue-prop',
hideSpacingValue: true
});

spacers({
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
showOnHover: true,
margin: true,
padding: true,
showSpacingValue: true,
// hideSpacingValue: true,
showLabel: 'Spacer Label',
enableLock: true,
// spacingUnit: 'em',
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defaultPadding|object|null|an object with initial padding spacer top, bottom, le
defaultMargin|object|null|an object with initial margin spacer top, bottom, left, right values. Overwrites the `defaultSpacing` parameter
spacingUnit|string|px|Change default spacing unit of spacers like em, rem, in, cm ..etc
showOnHover|string|false|Show spacers only on hover
showSpacingValue|boolean|false|Show the margin/padding values at the center of the spacer
hideSpacingValue|boolean|false|Hides the margin/padding values at the center of the spacer
showLabel|string|null|Enable and set the label to specified string beside the spacing value
enableLock|boolean|false|Link opposite spacers
lockIcon|string|```<span class="lock"></span>```|HTML string for the lock icon
Expand Down
6 changes: 3 additions & 3 deletions spacers/spacers.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function spacers( options ) {
enableMargin ? spacingProperties.push( 'margin' ) : '';
enablePadding ? spacingProperties.push( 'padding' ) : '';
let spacingDimensions = [ 'top', 'right', 'bottom', 'left' ];
let showSpacingValue = options.showSpacingValue == undefined || options.showSpacingValue == true ? true : false;
let hideSpacingValue = options.hideSpacingValue == true ? true : false;
let showLabel = options.showLabel ? options.showLabel : '';

margin = {
Expand Down Expand Up @@ -60,7 +60,7 @@ function spacers( options ) {

spacerSize = ( padding[dim] == "" ? defaultSpacing : padding[dim] );

spacerDivs += '<div data-size="'+ spacerSize +'" data-type="'+ property +'" data-id="'+ spacerId +'" class="spacer spacer-' + spacerId + ' spacer-'+ dim +'" data-dragging="'+ getOppositeDimension(dim) +'" data-position="'+ dim +'"> <span class="spacer-indicator"> <span class="'+ ( showSpacingValue ? '' : 'display-none ' ) +'spacer-size">'+ (spacerSize == '' ? '0' : spacerSize) +'</span>'+ showLabel + spacerLock + '</span> </div>';
spacerDivs += '<div data-size="'+ spacerSize +'" data-type="'+ property +'" data-id="'+ spacerId +'" class="spacer spacer-' + spacerId + ' spacer-'+ dim +'" data-dragging="'+ getOppositeDimension(dim) +'" data-position="'+ dim +'"> <span class="spacer-indicator"> <span class="'+ ( hideSpacingValue ? 'display-none ' : '' ) +'spacer-size">'+ (spacerSize == '' ? '0' : spacerSize) +'</span>'+ showLabel + spacerLock + '</span> </div>';

});
break;
Expand All @@ -70,7 +70,7 @@ function spacers( options ) {

spacerSize = ( margin[dim] == "0" ? defaultSpacing : margin[dim] );

spacerDivs += '<div data-size="'+ spacerSize +'" data-type="'+ property +'" data-id="'+ spacerId +'" class="spacer spacer-' + spacerId + ' spacer-'+ dim +'" data-dragging="'+ getOppositeDimension(dim) +'" data-position="'+ dim +'"> <span class="spacer-indicator"> <span class="'+ ( showSpacingValue ? '' : 'display-none ' ) +'spacer-size">'+ (spacerSize == '' ? '0' : spacerSize) +'</span>'+ showLabel + spacerLock + '</span> </div>';
spacerDivs += '<div data-size="'+ spacerSize +'" data-type="'+ property +'" data-id="'+ spacerId +'" class="spacer spacer-' + spacerId + ' spacer-'+ dim +'" data-dragging="'+ getOppositeDimension(dim) +'" data-position="'+ dim +'"> <span class="spacer-indicator"> <span class="'+ ( hideSpacingValue ? 'display-none ' : '' ) +'spacer-size">'+ (spacerSize == '' ? '0' : spacerSize) +'</span>'+ showLabel + spacerLock + '</span> </div>';

});
break;
Expand Down

0 comments on commit 5103568

Please sign in to comment.