[GCI] Standardised UI util code comments (#1344)

* standardise comments

* small fix

Co-authored-by: Jeffrey Warren <jeff@unterbahn.com>
This commit is contained in:
Harsh Khandeparkar
2020-01-01 22:56:41 +05:30
committed by Jeffrey Warren
parent d83703cf02
commit 1db650cdd7
3 changed files with 15 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
// Generate downscaled preview images for quick buttons.
function generatePreview(previewStepName, customValues, path, DomNode) {
var previewSequencer = ImageSequencer();
function insertPreview(src) {
@@ -52,8 +53,8 @@ function updatePreviews(src, DomNode) {
var height = img.height;
var width = img.width;
let percentage = (80 / height) * 100; //take the min resize value that fits the preview area => (new-width/orig_ht) - '80 as the preview area has 80*80 dimension
percentage = Math.max((80 / width) * 100, percentage); // make sure that one dimension doesn't resize greater, leading distorting preview-area fitting
let percentage = (80 / height) * 100; // Take the min resize value that fits the preview area => (new-width/orig_ht) - '80 as the preview area has 80*80 dimension.
percentage = Math.max((80 / width) * 100, percentage); // Make sure that one dimension doesn't resize greater, leading distorting preview-area fitting.
percentage = Math.ceil(percentage);
var sequencer = ImageSequencer();
@@ -74,4 +75,4 @@ function updatePreviews(src, DomNode) {
module.exports = {
generatePreview : generatePreview,
updatePreviews : updatePreviews
};
};