Skip to content

Commit

Permalink
Eoxia#193 [JS] add: event on range for show opp_percent value
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Dec 19, 2023
1 parent 9bf73f5 commit 6cb23f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<label for="opp_percent">
<?php echo $langs->trans('OpportunityProbability'); ?>
<?php echo '<br>' . img_picto('', 'fontawesome_fa-frown-open_fas_#c62828_2em', 'class="paddingright"'); ?>
<span class="opp_percent-value">0</span>
<input type="range" class="range" name="opp_percent" id="opp_percent" min="0" max="100" step="10" value="0">
<?php echo img_picto('', 'fontawesome_fa-laugh-beam_fas_#388e3c_2em'); ?>
</label>
Expand Down
2 changes: 1 addition & 1 deletion js/easycrm.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions js/modules/quickcreation.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ window.easycrm.quickcreation.event = function() {
$(document).on('click', '.image-validate', window.easycrm.quickcreation.createImg);
window.easycrm.quickcreation.getCurrentPosition();
$(document).on('submit', '.quickcreation-form', window.easycrm.quickcreation.vibratePhone);
$(document).on('input', '#opp_percent', window.easycrm.quickcreation.showOppPercentValue);
};

window.easycrm.quickcreation.uploadImage = function() {
Expand Down Expand Up @@ -312,3 +313,17 @@ window.easycrm.quickcreation.vibratePhone = function() {
navigator.vibrate([1000, 500, 200, 200, 500, 1000]);
}
};

/**
* Show opp percent value on range input
*
* @memberof EasyCRM_QuickCreation
*
* @since 1.3.0
* @version 1.3.0
*
* @return {void}
*/
window.easycrm.quickcreation.showOppPercentValue = function() {
$('.opp_percent-value').text($('#opp_percent').val());
};

0 comments on commit 6cb23f3

Please sign in to comment.