';
html += '
';
diff --git a/dashboard-ui/bower_components/iron-icon/.bower.json b/dashboard-ui/bower_components/iron-icon/.bower.json
index 9784e3a3b7..f0167baf13 100644
--- a/dashboard-ui/bower_components/iron-icon/.bower.json
+++ b/dashboard-ui/bower_components/iron-icon/.bower.json
@@ -32,14 +32,14 @@
"web-component-tester": "^4.0.0",
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0"
},
- "homepage": "https://github.com/PolymerElements/iron-icon",
+ "homepage": "https://github.com/polymerelements/iron-icon",
"_release": "1.0.8",
"_resolution": {
"type": "version",
"tag": "v1.0.8",
"commit": "f36b38928849ef3853db727faa8c9ef104d611eb"
},
- "_source": "git://github.com/PolymerElements/iron-icon.git",
+ "_source": "git://github.com/polymerelements/iron-icon.git",
"_target": "^1.0.0",
- "_originalSource": "PolymerElements/iron-icon"
+ "_originalSource": "polymerelements/iron-icon"
}
\ No newline at end of file
diff --git a/dashboard-ui/bower_components/iron-location/.bower.json b/dashboard-ui/bower_components/iron-location/.bower.json
index 73dd0ea15b..9463fa7581 100644
--- a/dashboard-ui/bower_components/iron-location/.bower.json
+++ b/dashboard-ui/bower_components/iron-location/.bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-location",
- "version": "0.8.3",
+ "version": "0.8.4",
"description": "Bidirectional data binding into the page's URL.",
"private": true,
"authors": [
@@ -37,11 +37,11 @@
"webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0",
"iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.2.3"
},
- "_release": "0.8.3",
+ "_release": "0.8.4",
"_resolution": {
"type": "version",
- "tag": "v0.8.3",
- "commit": "cb124aa740c07d2b65af1d7e05a3cf8fd6a25f87"
+ "tag": "v0.8.4",
+ "commit": "dcb05b63c0f367fde7ebfd3bebefee606f69dd68"
},
"_source": "git://github.com/PolymerElements/iron-location.git",
"_target": "^0.8.0",
diff --git a/dashboard-ui/bower_components/iron-location/.travis.yml b/dashboard-ui/bower_components/iron-location/.travis.yml
index e21d6edce3..fd5d0d0d5e 100644
--- a/dashboard-ui/bower_components/iron-location/.travis.yml
+++ b/dashboard-ui/bower_components/iron-location/.travis.yml
@@ -2,7 +2,7 @@ language: node_js
sudo: required
node_js: stable
addons:
- firefox: latest
+ firefox: '46.0'
apt:
sources:
- google-chrome
diff --git a/dashboard-ui/bower_components/iron-location/bower.json b/dashboard-ui/bower_components/iron-location/bower.json
index 6eb4fbe7e3..fb43be2818 100644
--- a/dashboard-ui/bower_components/iron-location/bower.json
+++ b/dashboard-ui/bower_components/iron-location/bower.json
@@ -1,6 +1,6 @@
{
"name": "iron-location",
- "version": "0.8.3",
+ "version": "0.8.4",
"description": "Bidirectional data binding into the page's URL.",
"private": true,
"authors": [
diff --git a/dashboard-ui/bower_components/iron-location/iron-location.html b/dashboard-ui/bower_components/iron-location/iron-location.html
index 58a72580af..ecd357a59b 100644
--- a/dashboard-ui/bower_components/iron-location/iron-location.html
+++ b/dashboard-ui/bower_components/iron-location/iron-location.html
@@ -125,9 +125,8 @@ milliseconds.
computed: '_makeRegExp(urlSpaceRegex)'
},
- _lastChangedAtAt: {
- type: Number,
- value: -Infinity
+ _lastChangedAt: {
+ type: Number
},
_initialized: {
@@ -146,6 +145,9 @@ milliseconds.
this.listen(window, 'location-changed', '_urlChanged');
this.listen(window, 'popstate', '_urlChanged');
this.listen(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
+ // Give a 200ms grace period to make initial redirects without any
+ // additions to the user's history.
+ this._lastChangedAt = window.performance.now() - (this.dwellTime - 200);
this._initialized = true;
this._urlChanged();
@@ -157,17 +159,6 @@ milliseconds.
this.unlisten(/** @type {!HTMLBodyElement} */(document.body), 'click', '_globalOnClick');
this._initialized = false;
},
- /**
- * @return {number} the number of milliseconds since some point in the
- * past. Only useful for comparing against other results from this
- * function.
- */
- _now: function() {
- if (window.performance && window.performance.now) {
- return window.performance.now();
- }
- return new Date().getTime();
- },
_hashChanged: function() {
this.hash = window.location.hash.substring(1);
},
@@ -212,7 +203,7 @@ milliseconds.
// Need to use a full URL in case the containing page has a base URI.
var fullNewUrl = new URL(
newUrl, window.location.protocol + '//' + window.location.host).href;
- var now = this._now();
+ var now = window.performance.now();
var shouldReplace =
this._lastChangedAt + this.dwellTime > now;
this._lastChangedAt = now;
@@ -230,6 +221,12 @@ milliseconds.
* @param {MouseEvent} event .
*/
_globalOnClick: function(event) {
+ // If another event handler has stopped this event then there's nothing
+ // for us to do. This can happen e.g. when there are multiple
+ // iron-location elements in a page.
+ if (event.defaultPrevented) {
+ return;
+ }
var href = this._getSameOriginLinkHref(event);
if (!href) {
return;
@@ -268,18 +265,18 @@ milliseconds.
// If there's no link there's nothing to do.
if (!anchor) {
- return;
+ return null;
}
// Target blank is a new tab, don't intercept.
if (anchor.target === '_blank') {
- return;
+ return null;
}
// If the link is for an existing parent frame, don't intercept.
if ((anchor.target === '_top' ||
anchor.target === '_parent') &&
window.top !== window) {
- return;
+ return null;
}
var href = anchor.href;
@@ -319,6 +316,11 @@ milliseconds.
// Need to use a full URL in case the containing page has a base URI.
var fullNormalizedHref = new URL(
normalizedHref, window.location.href).href;
+ // If the navigation is to the current page we shouldn't add a history
+ // entry.
+ if (fullNormalizedHref === window.location.href) {
+ return null;
+ }
return fullNormalizedHref;
},
_makeRegExp: function(urlSpaceRegex) {
diff --git a/dashboard-ui/bower_components/iron-location/test/iron-location.html b/dashboard-ui/bower_components/iron-location/test/iron-location.html
index 1952ae0bd3..c0f6c681ef 100644
--- a/dashboard-ui/bower_components/iron-location/test/iron-location.html
+++ b/dashboard-ui/bower_components/iron-location/test/iron-location.html
@@ -141,6 +141,34 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
'?greeting=hello&target=world&another=key');
});
});
+ suite('does not spam the user\'s history', function() {
+ var replaceStateCalls, pushStateCalls;
+ var nativeReplaceState, nativePushState;
+ setup(function() {
+ replaceStateCalls = pushStateCalls = 0;
+ nativeReplaceState = window.history.replaceState;
+ nativePushState = window.history.pushState;
+ window.history.replaceState = function() {
+ replaceStateCalls++;
+ };
+ window.history.pushState = function() {
+ pushStateCalls++;
+ };
+ });
+ teardown(function() {
+ window.history.replaceState = nativeReplaceState;
+ window.history.pushState = nativePushState;
+ });
+ test('when a change happens immediately after ' +
+ 'the iron-location is attached', function() {
+ var ironLocation = fixture('Solo');
+ expect(pushStateCalls).to.be.equal(0);
+ expect(replaceStateCalls).to.be.equal(0);
+ ironLocation.path = '/foo';
+ expect(replaceStateCalls).to.be.equal(1);
+ expect(pushStateCalls).to.be.equal(0);
+ });
+ });
suite('when used with other iron-location elements', function() {
var otherUrlElem;
var urlElem;
@@ -236,6 +264,35 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
anchor.target = '_blank';
expect(isClickCaptured(anchor)).to.be.eq(false);
+ });
+
+ test('a link with an href to the ' +
+ 'current page shouldn\'t add to history.', function() {
+ var anchor = document.createElement('a');
+ anchor.href = window.location.href;
+
+ expect(isClickCaptured(anchor)).to.be.equal(false);
+ });
+
+ test('a click that has already been defaultPrevented ' +
+ 'shouldn\'t result in a navigation', function() {
+ fixture('Solo');
+ var anchor = document.createElement('a');
+ anchor.href = makeAbsoluteUrl('/');
+ anchor.addEventListener('click', function(event) {
+ event.preventDefault();
+ });
+ document.body.appendChild(anchor);
+
+ var originalPushState = window.history.pushState;
+ var count = 0;
+ window.history.pushState = function() {
+ count++;
+ }
+ anchor.click();
+ window.history.pushState = originalPushState;
+
+ expect(count).to.be.equal(0);
})
});
diff --git a/dashboard-ui/bower_components/polymer/.bower.json b/dashboard-ui/bower_components/polymer/.bower.json
index 4782b3c50f..e3120e6882 100644
--- a/dashboard-ui/bower_components/polymer/.bower.json
+++ b/dashboard-ui/bower_components/polymer/.bower.json
@@ -39,6 +39,6 @@
"commit": "ce5b9fb2d8aa03c698410e2e55cffcfa0b788a3a"
},
"_source": "git://github.com/Polymer/polymer.git",
- "_target": "^1.0.0",
+ "_target": "^1.1.0",
"_originalSource": "Polymer/polymer"
}
\ No newline at end of file