From 4c45fc2ff835fdf049d9a51f3784cf7d8da849c2 Mon Sep 17 00:00:00 2001 From: javi Date: Mon, 28 Oct 2013 18:41:19 +0100 Subject: [PATCH] updated index to remove ui stuff with no_ui option --- index.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/index.html b/index.html index a32acd5..ee8bf3b 100644 --- a/index.html +++ b/index.html @@ -133,8 +133,10 @@ var torqueLayer; var ui; var editor; + var ui_enabled = false; var state = location.hash ? JSON.parse(atob(location.hash.substring(1))): {}; var DEFAULT_CARTOCSS = state.cartocss || $('#default-style').html(); + ui_enabled = location.search.indexOf('no_ui') === -1; function saveState() { location.hash = btoa(JSON.stringify({ @@ -170,7 +172,12 @@ torqueLayer.setCartoCSS(DEFAULT_CARTOCSS); init_slider(torqueLayer); - init_ui(map, torqueLayer); + if(ui_enabled) { + init_ui(map, torqueLayer); + } else { + var textarea = document.getElementById('code') + textarea.parentNode.removeChild(textarea); + } torqueLayer.on('change:bounds', function(changes) { var bounds = changes.bounds; var b = new google.maps.LatLngBounds(