From a5d567ba568134d857a05342c43e58531f4d09b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 22 Feb 2017 18:34:36 +0100 Subject: [PATCH 1/1] 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. --- index.html | 2 +- nanofun.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) 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')); -- 2.39.2