From 4a328d0004f9d788c416edd7cbe2d551d607d19d Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Thu, 27 Mar 2014 09:30:46 -0700 Subject: [PATCH 1/6] Fix failing IE test --- packages/test-helpers/domutils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/test-helpers/domutils.js b/packages/test-helpers/domutils.js index 0d2543f749..e5a29025e2 100644 --- a/packages/test-helpers/domutils.js +++ b/packages/test-helpers/domutils.js @@ -41,7 +41,7 @@ DomUtils.setElementValue = function (node, value) { // match valid OPTION values... and moreover, the OPTION value must be // explicitly given as an attribute, not just as the text. So we hunt for // the OPTION and select it. - var options = DomUtils.findAll(node, 'option'); + var options = $(node).find('option'); for (var i = 0; i < options.length; ++i) { if (DomUtils.getElementValue(options[i]) === value) { options[i].selected = true; From c89f5fd03045f619a0b3c752cbc11d81bc6cbf4c Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 27 Mar 2014 10:02:57 -0700 Subject: [PATCH 2/6] doc tweaks --- docs/client/api.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/client/api.html b/docs/client/api.html index cb0fb5f06f..41c88d2f72 100644 --- a/docs/client/api.html +++ b/docs/client/api.html @@ -1432,7 +1432,7 @@ variable every time a new version of your app is loaded. Example: // in main.html - {{lt}}template name="main> + {{lt}}template name="main">

We've always been at war with {{dstache}}theEnemy}}.

{{lt}}/template> @@ -2206,7 +2206,7 @@ data used changes. will continue running in your browser forever. Additionally, if you remove any part of your DOM using any mechanism other than jQuery, the logic to keep that part of the the DOM updated will continue running. To avoid these issues, - either avoid directly updating the DOM and ensure that any removals go through + either avoid directly updating the DOM or ensure that any removals go through jQuery. {{/warning}} From 172f709a5ff5f1186455604b90d8b45d64cba8f9 Mon Sep 17 00:00:00 2001 From: Emily Stark Date: Thu, 27 Mar 2014 10:57:55 -0700 Subject: [PATCH 3/6] Fix bug where event handler return values weren't being used. --- packages/spacebars-tests/template_tests.html | 4 +++ packages/spacebars-tests/template_tests.js | 34 ++++++++++++++------ packages/ui/base.js | 5 +-- 3 files changed, 32 insertions(+), 11 deletions(-) diff --git a/packages/spacebars-tests/template_tests.html b/packages/spacebars-tests/template_tests.html index 6e2b6d2b46..2a49eb661e 100644 --- a/packages/spacebars-tests/template_tests.html +++ b/packages/spacebars-tests/template_tests.html @@ -659,3 +659,7 @@ Hi there! + + diff --git a/packages/spacebars-tests/template_tests.js b/packages/spacebars-tests/template_tests.js index 22f9b4299c..1333fb8bbf 100644 --- a/packages/spacebars-tests/template_tests.js +++ b/packages/spacebars-tests/template_tests.js @@ -16,6 +16,15 @@ var nodesToArray = function (array) { return _.map(array, _.identity); }; +var clickIt = function (elem) { + // jQuery's bubbling change event polyfill for IE 8 seems + // to require that the element in question have focus when + // it receives a simulated click. + if (elem.focus) + elem.focus(); + clickElement(elem); +}; + Tinytest.add("spacebars - templates - simple helper", function (test) { var tmpl = Template.spacebars_template_test_simple_helper; var R = ReactiveVar(1); @@ -1499,15 +1508,6 @@ Tinytest.add("spacebars - controls - radio", function(test) { test.equal(_.pluck(btns, 'checked'), [false, false, false]); test.equal(text(), "Band: "); - var clickIt = function (elem) { - // jQuery's bubbling change event polyfill for IE 8 seems - // to require that the element in question have focus when - // it receives a simulated click. - if (elem.focus) - elem.focus(); - clickElement(elem); - }; - clickIt(btns[0]); test.equal(change_buf, ['AM']); change_buf.length = 0; @@ -1815,3 +1815,19 @@ Tinytest.add("spacebars - template - helpers don't leak", function (test) { var div = renderToDiv(tmpl); divRendersTo(test, div, "correct BONUS"); }); + +Tinytest.add( + "spacebars - template - event handler returns false", + function (test) { + var tmpl = Template.spacebars_test_event_returns_false; + var elemId = "spacebars_test_event_returns_false_link"; + tmpl.events({ + 'click a': function (evt) { return false; } + }); + + var div = renderToDiv(tmpl); + document.body.appendChild(div); + clickIt(document.getElementById(elemId)); + test.isFalse(/#bad-url/.test(window.location.hash)); + } +); diff --git a/packages/ui/base.js b/packages/ui/base.js index 6cc4122f68..c285d16e49 100644 --- a/packages/ui/base.js +++ b/packages/ui/base.js @@ -304,14 +304,15 @@ UI.Component.notifyParented = function () { var comp = UI.DomRange.getContainingComponent(event.currentTarget); var data = comp && getComponentData(comp); updateTemplateInstance(self); - Deps.nonreactive(function () { + return Deps.nonreactive(function () { // Don't want to be in a deps context, even if we were somehow // triggered synchronously in an existing deps context // (the `blur` event can do this). // XXX we should probably do what Spark did and block all // event handling during our DOM manip. Many apps had weird // unanticipated bugs until we did that. - esh.handler.call(data === null ? {} : data, event, self.templateInstance); + return esh.handler.call(data === null ? {} : data, + event, self.templateInstance); }); }; From 13561c0c133e99b9037602f2c464e4125f11e715 Mon Sep 17 00:00:00 2001 From: Emily Stark Date: Thu, 27 Mar 2014 11:37:16 -0700 Subject: [PATCH 4/6] Remove element from DOM after test --- packages/spacebars-tests/template_tests.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/spacebars-tests/template_tests.js b/packages/spacebars-tests/template_tests.js index 1333fb8bbf..8f10f85f9c 100644 --- a/packages/spacebars-tests/template_tests.js +++ b/packages/spacebars-tests/template_tests.js @@ -1829,5 +1829,6 @@ Tinytest.add( document.body.appendChild(div); clickIt(document.getElementById(elemId)); test.isFalse(/#bad-url/.test(window.location.hash)); + document.body.removeChild(div); } ); From aa903dc6be7db7940bf238fef78c8aa0575a62ad Mon Sep 17 00:00:00 2001 From: David Glasser Date: Thu, 27 Mar 2014 12:59:21 -0700 Subject: [PATCH 5/6] docs: Fix trailing comma (breaks IE8) --- docs/client/docs.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/client/docs.js b/docs/client/docs.js index 5d78f53055..3c004adca7 100644 --- a/docs/client/docs.js +++ b/docs/client/docs.js @@ -212,7 +212,7 @@ var toc = [ "Accounts.onCreateUser", "Accounts.validateLoginAttempt", "Accounts.onLogin", - {name: "Accounts.onLoginFailure", id: "accounts_onlogin"}, + {name: "Accounts.onLoginFailure", id: "accounts_onlogin"} ], {name: "Passwords", id: "accounts_passwords"}, [ @@ -380,6 +380,10 @@ Template.nav.sections = function () { var ret = []; var walk = function (items, depth) { _.each(items, function (item) { + // Work around (eg) accidental trailing commas leading to spurious holes + // in IE8. + if (!item) + return; if (item instanceof Array) walk(item, depth + 1); else { From b0ef1ce9a127fd314fdaeb18a5a66e241d03a186 Mon Sep 17 00:00:00 2001 From: Avital Oliver Date: Thu, 27 Mar 2014 15:46:00 -0700 Subject: [PATCH 6/6] Update apps to 0.8.0 --- docs/.meteor/release | 2 +- docs/lib/release-override.js | 2 +- examples/clock/.meteor/release | 2 +- examples/leaderboard/.meteor/release | 2 +- examples/parties/.meteor/release | 2 +- examples/todos/.meteor/release | 2 +- examples/wordplay/.meteor/release | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/.meteor/release b/docs/.meteor/release index 6b184fbe05..a3df0a6959 100644 --- a/docs/.meteor/release +++ b/docs/.meteor/release @@ -1 +1 @@ -0.8.0-rc3 +0.8.0 diff --git a/docs/lib/release-override.js b/docs/lib/release-override.js index b99159cbf3..df4928d93b 100644 --- a/docs/lib/release-override.js +++ b/docs/lib/release-override.js @@ -1,5 +1,5 @@ // While galaxy apps are on their own special meteor releases, override // Meteor.release here. if (Meteor.isClient) { - Meteor.release = Meteor.release ? "0.7.2" : undefined; + Meteor.release = Meteor.release ? "0.8.0" : undefined; } diff --git a/examples/clock/.meteor/release b/examples/clock/.meteor/release index 621e94f0ec..a3df0a6959 100644 --- a/examples/clock/.meteor/release +++ b/examples/clock/.meteor/release @@ -1 +1 @@ -none +0.8.0 diff --git a/examples/leaderboard/.meteor/release b/examples/leaderboard/.meteor/release index 7486fdbc50..a3df0a6959 100644 --- a/examples/leaderboard/.meteor/release +++ b/examples/leaderboard/.meteor/release @@ -1 +1 @@ -0.7.2 +0.8.0 diff --git a/examples/parties/.meteor/release b/examples/parties/.meteor/release index 7486fdbc50..a3df0a6959 100644 --- a/examples/parties/.meteor/release +++ b/examples/parties/.meteor/release @@ -1 +1 @@ -0.7.2 +0.8.0 diff --git a/examples/todos/.meteor/release b/examples/todos/.meteor/release index 7486fdbc50..a3df0a6959 100644 --- a/examples/todos/.meteor/release +++ b/examples/todos/.meteor/release @@ -1 +1 @@ -0.7.2 +0.8.0 diff --git a/examples/wordplay/.meteor/release b/examples/wordplay/.meteor/release index 7486fdbc50..a3df0a6959 100644 --- a/examples/wordplay/.meteor/release +++ b/examples/wordplay/.meteor/release @@ -1 +1 @@ -0.7.2 +0.8.0