From: Frédéric Péters Date: Wed, 22 Feb 2017 17:34:36 +0000 (+0100) Subject: create pads from a template, then delete the template X-Git-Url: https://git.0d.be/?p=nanofun.git;a=commitdiff_plain;h=a5d567ba568134d857a05342c43e58531f4d09b7 create pads from a template, then delete the template This works around a margin bug that made the first element have a slightly larger right margin. --- diff --git a/index.html b/index.html index 9c92333..fad9fb2 100644 --- a/index.html +++ b/index.html @@ -11,7 +11,7 @@
-
+
diff --git a/nanofun.js b/nanofun.js index 34e1dcc..3fd7203 100644 --- a/nanofun.js +++ b/nanofun.js @@ -333,11 +333,12 @@ var nanofun = function() { self.initUI = function() { var $nanopad = $('#nanopad'); var $nanotouch = $('.nanotouch'); - for (var i=1; i<16; i++) { + for (var i=0; i<16; i++) { var $new_touch = $nanotouch.clone(); $new_touch.attr('data-touch', i); $new_touch.appendTo($nanopad); } + $nanotouch.remove(); /* remove template */ $('.nanotouch input[type=file]').on('change', function(ev) { var sample_idx = parseInt($(this).parent().data('touch'));