From 326d21d1430778f29df36e692d804d140711f47d Mon Sep 17 00:00:00 2001 From: Don Mitchell Date: Wed, 19 Dec 2012 10:48:03 -0500 Subject: [PATCH] ie7 fixes: define indexOf, use charAt rather than [] to access string, put try/catch around fn that was throwing errors. --- lms/static/coffee/src/main.coffee | 8 ++++++++ lms/static/sass/bourbon/css3/_box-sizing.scss | 1 - lms/static/scripts/boxsizing.htc | 5 ++++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/lms/static/coffee/src/main.coffee b/lms/static/coffee/src/main.coffee index ec5cbdec5b..3b000ba4f3 100644 --- a/lms/static/coffee/src/main.coffee +++ b/lms/static/coffee/src/main.coffee @@ -37,3 +37,11 @@ $ -> $('#signup').click -> $('#signup-modal input[name="email"]').focus() false + + # fix for ie + if !Array::indexOf + Array::indexOf = (obj, start = 0) -> + for ele, i in this[start..] + if ele is obj + return i + start + return -1 diff --git a/lms/static/sass/bourbon/css3/_box-sizing.scss b/lms/static/sass/bourbon/css3/_box-sizing.scss index 42aaaf6fc7..d61523b5f1 100644 --- a/lms/static/sass/bourbon/css3/_box-sizing.scss +++ b/lms/static/sass/bourbon/css3/_box-sizing.scss @@ -2,6 +2,5 @@ // content-box | border-box | inherit -webkit-box-sizing: $box; -moz-box-sizing: $box; - box-sizing: $box; box-sizing: $box; *behavior: url(/static/scripts/boxsizing.htc); } diff --git a/lms/static/scripts/boxsizing.htc b/lms/static/scripts/boxsizing.htc index 43bd86fae1..40f5ab4e12 100644 --- a/lms/static/scripts/boxsizing.htc +++ b/lms/static/scripts/boxsizing.htc @@ -85,7 +85,10 @@ function update(){ } resizetimeout = window.setTimeout(function(){ restore(); - init(); + try { + init(); + } + catch (err) {} resizetimeout = null; },100); }