-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to decide what to display in case there was no price change in …
…the tracked history span.
- Loading branch information
1 parent
6296ecb
commit bd59bf0
Showing
8 changed files
with
271 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,27 @@ | ||
jQuery(document).ready(function($) { | ||
|
||
// Toggle the custom text field when the custom text radio button is selected. | ||
$( '#wc-price-history-old-history-fieldset input' ).on( | ||
'change', | ||
function() { | ||
if ( $( '#wc-price-history-old-history-fieldset input:checked' ).val() == 'custom_text' ) { | ||
$( '.wc-price-history-old-history-custom-text-p' ).removeClass( 'hidden-fade' ); | ||
} else { | ||
$( '.wc-price-history-old-history-custom-text-p' ).addClass( 'hidden-fade' ); | ||
} | ||
} | ||
); | ||
|
||
// There are tesxts like "What to do when price history is older than {days-set} days" on the page's HTML code. | ||
// copy value from input field #wc-price-history-days-number to every place on page where is {days-set} placeholder in pages HTML (replace it). | ||
$( '#wc-price-history-days-number' ).on( | ||
'input', | ||
function() { | ||
$( '.wc-price-history-days-set' ).each( | ||
function() { | ||
$( this ).text( $( '#wc-price-history-days-number' ).val() ); | ||
} | ||
); | ||
} | ||
); | ||
}); |
Oops, something went wrong.