Skip to content

Commit

Permalink
remove console.logs, expand crop button bar if there is space and the…
Browse files Browse the repository at this point in the history
…re are lots of buttons
  • Loading branch information
ryanmark committed Jun 20, 2017
1 parent f9d6d83 commit 2149df8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/waterbug.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</div>

<div class="row">
<div class="form-group col-lg-6">
<div class="form-group col-lg-6 crops-wrapper">
<label for="crop">Crop</label>
<div class="btn-group btn-group-justified btn-group-sm crops" data-toggle="buttons">
</div>
Expand Down
7 changes: 4 additions & 3 deletions www/js/waterbug.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var onDocumentLoad = function(e) {
$fileinput = $('.fileinput');
$customFilename = $('.custom-filename');
$logosWrapper = $('.logos-wrapper');
$cropsWrapper = $('.crops-wrapper');
$cell = $('.canvas-cell');

canvasWidth = cropOptions[currentCrop].width;
Expand Down Expand Up @@ -136,6 +137,9 @@ var buildForm = function() {
$logo.on('change', onLogoChange);
} else {
$logosWrapper.hide();
if ( cropKeys.length > 2 ) {
$cropsWrapper.removeClass('col-lg-6').addClass('col-lg-12');
}
}

var $crops = $('.crops');
Expand All @@ -161,7 +165,6 @@ var buildForm = function() {
*/
var renderCanvas = function() {
// Set the canvas width
console.log('crop: ' + currentCrop);
canvas.width = cropOptions[currentCrop].width;

// clear the canvas
Expand Down Expand Up @@ -257,8 +260,6 @@ var renderCanvas = function() {

var creditWidth = ctx.measureText(credit);

console.log('creditWidth', parseInt(fontSize));

var textXY = calcPosition(currentTextPosition, creditWidth.width, parseInt(fontSize), true);
ctx.fillText(
credit,
Expand Down

0 comments on commit 2149df8

Please sign in to comment.