From 9eb19c56f0531b37e9d2a60cbdd8497f1a39c0aa Mon Sep 17 00:00:00 2001 From: "Andrew C. Dvorak" Date: Mon, 5 Mar 2018 14:22:58 -0800 Subject: [PATCH 1/2] fix: Use `var` instead of `const` in menu demo Safari 9.x and IE 10 do not support `const` --- demos/menu.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/demos/menu.html b/demos/menu.html index 87685f735d5..44308cf2d49 100644 --- a/demos/menu.html +++ b/demos/menu.html @@ -320,15 +320,15 @@ }); } - const marginInputsEl = document.querySelector('#margin-inputs'); + var marginInputsEl = document.querySelector('#margin-inputs'); var inputs = marginInputsEl.querySelectorAll('input[type="text"]'); for (var i = 0; i < inputs.length; i++) { inputs[i].addEventListener('change', function(evt) { - const topMarginInput = document.getElementById('top-margin'); - const bottomMarginInput = document.getElementById('bottom-margin'); - const rightMarginInput = document.getElementById('right-margin'); - const leftMarginInput = document.getElementById('left-margin'); - const margin = {top: parseInt(topMarginInput.value, 10), + var topMarginInput = document.getElementById('top-margin'); + var bottomMarginInput = document.getElementById('bottom-margin'); + var rightMarginInput = document.getElementById('right-margin'); + var leftMarginInput = document.getElementById('left-margin'); + var margin = {top: parseInt(topMarginInput.value, 10), right: parseInt(rightMarginInput.value, 10), bottom: parseInt(bottomMarginInput.value, 10), left: parseInt(leftMarginInput.value, 10)}; @@ -336,9 +336,9 @@ }); } - const rtl = document.querySelector('input[name="is-rtl"]'); + var rtl = document.querySelector('input[name="is-rtl"]'); rtl.addEventListener('change', function() { - const demoWrapper = document.getElementById('demo-wrapper'); + var demoWrapper = document.getElementById('demo-wrapper'); if (rtl.checked) { demoWrapper.setAttribute('dir', 'rtl'); } else { From e6e267a097d70ea3ea3db3a631610fa1d31526f4 Mon Sep 17 00:00:00 2001 From: "Andrew C. Dvorak" Date: Mon, 5 Mar 2018 14:26:50 -0800 Subject: [PATCH 2/2] WIP: Fix indentation --- demos/menu.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/demos/menu.html b/demos/menu.html index 44308cf2d49..09c3c00e6ef 100644 --- a/demos/menu.html +++ b/demos/menu.html @@ -329,9 +329,9 @@ var rightMarginInput = document.getElementById('right-margin'); var leftMarginInput = document.getElementById('left-margin'); var margin = {top: parseInt(topMarginInput.value, 10), - right: parseInt(rightMarginInput.value, 10), - bottom: parseInt(bottomMarginInput.value, 10), - left: parseInt(leftMarginInput.value, 10)}; + right: parseInt(rightMarginInput.value, 10), + bottom: parseInt(bottomMarginInput.value, 10), + left: parseInt(leftMarginInput.value, 10)}; menu.setAnchorMargin(margin); }); }