From 527b253f588776e5f72a0a0d1e93195cd3f82707 Mon Sep 17 00:00:00 2001 From: glorieux Date: Sat, 2 Jul 2016 14:52:24 +0200 Subject: [PATCH] x/tools/cmd/present: Fix present not working on Safari As described on https://github.com/golang/go/issues/16216 present is not currently working on Safari because of the use of ES6 JavaScript let statements. The solution is to use var statements instead of let. Fixes golang/go#16216 Change-Id: I44c84f920aa41dfc8de5997ab50a440de6d57093 Reviewed-on: https://go-review.googlesource.com/24721 Reviewed-by: Andrew Gerrand --- cmd/present/static/slides.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/present/static/slides.js b/cmd/present/static/slides.js index ceb651bd47..f055bb5070 100644 --- a/cmd/present/static/slides.js +++ b/cmd/present/static/slides.js @@ -538,7 +538,7 @@ function setupNotesSync() { function setupPlayResizeSync() { var out = document.getElementsByClassName('output'); - for (let i = 0; i < out.length; i++) { + for (var i = 0; i < out.length; i++) { $(out[i]).bind('resize', function(event) { if ($(event.target).hasClass('ui-resizable')) { localStorage.setItem('play-index', i); @@ -549,7 +549,7 @@ function setupNotesSync() { }; function setupPlayCodeSync() { var play = document.querySelectorAll('div.playground'); - for (let i = 0; i < play.length; i++) { + for (var i = 0; i < play.length; i++) { play[i].addEventListener('input', inputHandler, false); function inputHandler(e) {