diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index bd99dcd5b9..ea0e29e120 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/.bower.json +++ b/dashboard-ui/bower_components/emby-webcomponents/.bower.json @@ -15,12 +15,12 @@ }, "devDependencies": {}, "ignore": [], - "version": "1.0.72", - "_release": "1.0.72", + "version": "1.0.73", + "_release": "1.0.73", "_resolution": { "type": "version", - "tag": "1.0.72", - "commit": "c06518f026fe592c24aa79312dcecf025e604ef4" + "tag": "1.0.73", + "commit": "da24184a3afaddf25b6d6ffa41363dedee7e63d2" }, "_source": "git://github.com/MediaBrowser/emby-webcomponents.git", "_target": "~1.0.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js b/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js index a4ef3d0f0c..8e5b525c56 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js +++ b/dashboard-ui/bower_components/emby-webcomponents/prompt/prompt.js @@ -1,4 +1,4 @@ -define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager) { +define(['paperdialoghelper', 'layoutManager', 'globalize', 'dialogText', 'html!./icons.html', 'css!./style.css', 'paper-button', 'paper-input'], function (paperdialoghelper, layoutManager, globalize, dialogText) { function show(options, resolve, reject) { @@ -37,10 +37,12 @@ define(['paperdialoghelper', 'layoutManager', 'html!./icons.html', 'css!./style. // TODO: An actual form element should probably be added html += '
'; if (raisedButtons) { - html += '' + Globalize.translate('core#ButtonOk') + ''; + html += '' + globalize.translate(dialogText.buttonOk) + ''; } else { - html += '' + Globalize.translate('core#ButtonOk') + ''; - html += '' + Globalize.translate('core#ButtonCancel') + ''; + html += '
'; + html += '' + globalize.translate(dialogText.buttonOk) + ''; + html += '' + globalize.translate(dialogText.buttonCancel) + ''; + html += '
'; } html += ''; diff --git a/dashboard-ui/bower_components/iron-dropdown/.bower.json b/dashboard-ui/bower_components/iron-dropdown/.bower.json index aca2b46fb4..b76dd1702a 100644 --- a/dashboard-ui/bower_components/iron-dropdown/.bower.json +++ b/dashboard-ui/bower_components/iron-dropdown/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-dropdown", - "version": "1.1.0", + "version": "1.2.0", "description": "An unstyled element that works similarly to a native browser select", "authors": [ "The Polymer Authors" @@ -32,15 +32,15 @@ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0", "paper-styles": "polymerelements/paper-styles#^1.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "web-component-tester": "*", + "web-component-tester": "^4.0.0", "iron-image": "polymerelements/iron-image#^1.0.0" }, "ignore": [], - "_release": "1.1.0", + "_release": "1.2.0", "_resolution": { "type": "version", - "tag": "v1.1.0", - "commit": "b09b0d57ba917bac9315de4761373d88e85ac52e" + "tag": "v1.2.0", + "commit": "f864191c6ffbd3aaddea8102102ab40137046327" }, "_source": "git://github.com/polymerelements/iron-dropdown.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-dropdown/.travis.yml b/dashboard-ui/bower_components/iron-dropdown/.travis.yml index 60801d0689..771c6b21b4 100644 --- a/dashboard-ui/bower_components/iron-dropdown/.travis.yml +++ b/dashboard-ui/bower_components/iron-dropdown/.travis.yml @@ -1,22 +1,25 @@ language: node_js sudo: false before_script: - - npm install web-component-tester - - npm install bower - - 'export PATH=$PWD/node_modules/.bin:$PATH' + - npm install -g bower polylint web-component-tester - bower install + - polylint env: global: - secure: Nd7sbgkYVekuQRB4K3svNCL3veA6t6aGopNP2FUxlJvQuzRV1vKV67angPvMUAFelEA7/rTzrFPBMfNbsz9C2wInLLLPux4wEk1MQX+2KYZVeXKMHjgl8iQKMXnodaL7XXwBPg0L7053TWtYkIt8wZ/vN0JGPQFKhlQkSrduztkPCJQfkFsMPJ7SudPG3Ld0UPBVxo8TwH/d44p8VhLGiI0oEWw3GnGZZ1T7RJLDAVBwj1BiVHAOaS0SSeOR3ngpZyXbk8OItgzw4o/bbAt2yrHMfwymBy0Xv9v3G0QLFJnMi/gE2lWnN4+IttUPI8gVyr1TuiTgtFxdwteLO3R5iFe+qlQjq0VGssmAHcPwtLhvrT4wEkGMc8ZeyW11z+GdkIw4XHGACWj+9Jz9f19mJd9xU3fkJ+f5mFiB8vEkzjsUI9pswgd3RoHt2WewcVdHnCED2wRdQCw9H34dX7d2ieWKPl/pv+EKZOgEJJ8UNZMyKnj57Y25WRrTpIQBt6p9uVv5MsiZQm7Sd1pYQnJKPQ+BxvvL5fsoT1YkFSjyz9gwijtftXhfL8KLB6i04V3mra3f9d5hc20wAOt+ad+mTOkaM/aGxE/I3Ko13BceMvRSNzuz+N2WE6FEJj1NuOCW/AeSh5/6n9nnlDeu7Nu7VeM9kjk4dyBGNRDWLNcSCEk= - secure: aFsYKL6Sw8/r57wzj3pnzEwBE1mnTajJasHAbXgQMd336S2Sq/f39DCNTXgKBA4AKZGvWKe8w9nzaocQoMa4l9bLWEBJMCMPQFawOhTkuEjsLjpU3g74b46/EhjBP5zixR32xoyF5o9FTzC6UyrDjt2XpKwIQJYxaEfoyIW1vTPdoasWdaG5rXvWFTsmXtaMDpCKFH9aQ1DHn9Sbi9NZlR4izdULsbv9GZwg53xvuH4xYEkGtB29KKy04uK1nJ+9SmRWTAnu4Q/ivYWlbwBArjiYTTi0wclvDNvT1iaFNAaeK2pJea8CnoyJJ0pg9NcuzZtStGUvP00kGUpJQ4lqkr+gBCHDPYtoZ17XCz59cg6LrhG1q//vPi7Yz0xW51GHuwmcVs+PsjmWaRuO/1UFreDCQYf+GU4I1pQZf2q1R4m8noe4i5CcFXLKTrC4udBzPmzVB4As2LsxRc3HCIXmhaMxI8MJwdkQBA22u4vCwU2xpqBawJocj0Gvbeme6wG99PW7+XSkijQDk2cTJ5/CJtY22nAECvn4tve3OVvybSTjQ1yipLxJm/dtjgEXFWtknFZr++tId88wPd3EBtrwEhliD3zD/TyLPO2RPZGuI0i6oD3O89P5d8qp66T/eByDr1IEm0+FIQjgiCEMbhmaIuUKGG2GCfwPglI3uR0kbg0= -node_js: 4 + - CXX=g++-4.8 +node_js: stable addons: firefox: latest apt: sources: - google-chrome + - ubuntu-toolchain-r-test packages: - google-chrome-stable + - g++-4.8 + sauce_connect: true script: - xvfb-run wct - "if [ \"${TRAVIS_PULL_REQUEST}\" = \"false\" ]; then wct -s 'default'; fi" diff --git a/dashboard-ui/bower_components/iron-dropdown/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-dropdown/CONTRIBUTING.md index 7b10141565..f147978a3e 100644 --- a/dashboard-ui/bower_components/iron-dropdown/CONTRIBUTING.md +++ b/dashboard-ui/bower_components/iron-dropdown/CONTRIBUTING.md @@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md If you edit that file, it will get updated everywhere else. If you edit this file, your changes will get overridden :) + +You can however override the jsbin link with one that's customized to this +specific element: + +jsbin=https://jsbin.com/cagaye/edit?html,output --> # Polymer Elements ## Guide for Contributors @@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag 3. Click the `paper-foo` element. ``` - 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). + 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output). 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. @@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag When submitting pull requests, please provide: - 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: + 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax: ```markdown (For a single issue) Fixes #20 (For multiple issues) - Fixes #32, #40 + Fixes #32, fixes #40 ``` 2. **A succinct description of the design** used to fix any related issues. For example: diff --git a/dashboard-ui/bower_components/iron-dropdown/bower.json b/dashboard-ui/bower_components/iron-dropdown/bower.json index a047d31933..8b9b75b4b4 100644 --- a/dashboard-ui/bower_components/iron-dropdown/bower.json +++ b/dashboard-ui/bower_components/iron-dropdown/bower.json @@ -1,6 +1,6 @@ { "name": "iron-dropdown", - "version": "1.1.0", + "version": "1.2.0", "description": "An unstyled element that works similarly to a native browser select", "authors": [ "The Polymer Authors" @@ -32,7 +32,7 @@ "iron-test-helpers": "polymerelements/iron-test-helpers#^1.0.0", "paper-styles": "polymerelements/paper-styles#^1.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0", - "web-component-tester": "*", + "web-component-tester": "^4.0.0", "iron-image": "polymerelements/iron-image#^1.0.0" }, "ignore": [] diff --git a/dashboard-ui/bower_components/iron-dropdown/iron-dropdown-scroll-manager.html b/dashboard-ui/bower_components/iron-dropdown/iron-dropdown-scroll-manager.html index 74234483f3..14f8933d01 100644 --- a/dashboard-ui/bower_components/iron-dropdown/iron-dropdown-scroll-manager.html +++ b/dashboard-ui/bower_components/iron-dropdown/iron-dropdown-scroll-manager.html @@ -79,6 +79,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN * @param {HTMLElement} element The element that should lock scroll. */ pushScrollLock: function(element) { + // Prevent pushing the same element twice + if (this._lockingElements.indexOf(element) >= 0) { + return; + } + if (this._lockingElements.length === 0) { this._lockScrollInteractions(); } @@ -172,7 +177,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN _scrollInteractionHandler: function(event) { if (Polymer .IronDropdownScrollManager - .elementIsScrollLocked(event.target)) { + .elementIsScrollLocked(Polymer.dom(event).rootTarget)) { if (event.type === 'keydown' && !Polymer.IronDropdownScrollManager._isScrollingKeypress(event)) { return; @@ -199,13 +204,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN document.body.style.overflowY = 'hidden'; // Modern `wheel` event for mouse wheel scrolling: - window.addEventListener('wheel', this._scrollInteractionHandler, true); + document.addEventListener('wheel', this._scrollInteractionHandler, true); // Older, non-standard `mousewheel` event for some FF: - window.addEventListener('mousewheel', this._scrollInteractionHandler, true); + document.addEventListener('mousewheel', this._scrollInteractionHandler, true); // IE: - window.addEventListener('DOMMouseScroll', this._scrollInteractionHandler, true); + document.addEventListener('DOMMouseScroll', this._scrollInteractionHandler, true); // Mobile devices can scroll on touch move: - window.addEventListener('touchmove', this._scrollInteractionHandler, true); + document.addEventListener('touchmove', this._scrollInteractionHandler, true); // Capture keydown to prevent scrolling keys (pageup, pagedown etc.) document.addEventListener('keydown', this._scrollInteractionHandler, true); }, @@ -215,10 +220,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN document.body.style.overflowX = this._originalBodyStyles.overflowX; document.body.style.overflowY = this._originalBodyStyles.overflowY; - window.removeEventListener('wheel', this._scrollInteractionHandler, true); - window.removeEventListener('mousewheel', this._scrollInteractionHandler, true); - window.removeEventListener('DOMMouseScroll', this._scrollInteractionHandler, true); - window.removeEventListener('touchmove', this._scrollInteractionHandler, true); + document.removeEventListener('wheel', this._scrollInteractionHandler, true); + document.removeEventListener('mousewheel', this._scrollInteractionHandler, true); + document.removeEventListener('DOMMouseScroll', this._scrollInteractionHandler, true); + document.removeEventListener('touchmove', this._scrollInteractionHandler, true); document.removeEventListener('keydown', this._scrollInteractionHandler, true); } }; diff --git a/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html b/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html index 3cb084bc4a..b4c0e6131b 100644 --- a/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html +++ b/dashboard-ui/bower_components/iron-dropdown/iron-dropdown.html @@ -224,6 +224,7 @@ method is called on the element. /** * The element that should be focused when the dropdown opens. + * @deprecated */ get _focusTarget() { return this.focusTarget || this.containedElement; @@ -323,10 +324,6 @@ method is called on the element. this._prepareDropdown(); Polymer.IronOverlayBehaviorImpl._openedChanged.apply(this, arguments); } - - if (this.opened) { - this._focusContent(); - } }, /** @@ -381,7 +378,7 @@ method is called on the element. var scrollTop; var scrollLeft; - if (containedElement) { + if (this.opened && containedElement) { scrollTop = containedElement.scrollTop; scrollLeft = containedElement.scrollLeft; } @@ -392,7 +389,7 @@ method is called on the element. Polymer.IronOverlayBehaviorImpl._onIronResize.apply(this, arguments); - if (containedElement) { + if (this.opened && containedElement) { containedElement.scrollTop = scrollTop; containedElement.scrollLeft = scrollLeft; } @@ -477,16 +474,15 @@ method is called on the element. }, /** - * Focuses the configured focus target. + * Apply focus to focusTarget or containedElement */ - _focusContent: function() { - // NOTE(cdata): This is async so that it can attempt the focus after - // `display: none` is removed from the element. - this.async(function() { - if (this._focusTarget) { - this._focusTarget.focus(); - } - }); + _applyFocus: function () { + var focusTarget = this.focusTarget || this.containedElement; + if (focusTarget && this.opened && !this.noAutoFocus) { + focusTarget.focus(); + } else { + Polymer.IronOverlayBehaviorImpl._applyFocus.apply(this, arguments); + } } }); })(); diff --git a/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown-scroll-manager.html b/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown-scroll-manager.html index 33cdcea2a2..885a5f91a1 100644 --- a/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown-scroll-manager.html +++ b/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown-scroll-manager.html @@ -21,19 +21,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + diff --git a/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown.html b/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown.html index 1031e39189..b355352f15 100644 --- a/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown.html +++ b/dashboard-ui/bower_components/iron-dropdown/test/iron-dropdown.html @@ -118,6 +118,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN contentRect.height > 0; } + function runAfterOpen(overlay, cb) { + overlay.addEventListener('iron-overlay-opened', function () { + Polymer.Base.async(cb, 1); + }); + overlay.open(); + } + suite('', function() { var dropdown; var content; @@ -133,31 +140,20 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); test('shows dropdown content when opened', function(done) { - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { expect(elementIsVisible(content)).to.be.equal(true); done(); }); }); test('hides dropdown content when outside is clicked', function(done) { - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { expect(elementIsVisible(content)).to.be.equal(true); - - // The document capture-click listeners are set async. - // Note(noms): I think this bit in iron-overlay-behavior is pretty - // brittle, so if the tests start failing in the future, make sure - // _toggleListeners is getting called at the right time. + MockInteractions.tap(dropdown.parentNode); Polymer.Base.async(function() { - MockInteractions.tap(dropdown.parentNode); - Polymer.Base.async(function() { - expect(elementIsVisible(content)).to.be.equal(false); - done(); - }, 100); - }, 1); + expect(elementIsVisible(content)).to.be.equal(false); + done(); + }, 10); }); }); @@ -167,9 +163,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN content = Polymer.dom(dropdown).querySelector('.dropdown-content'); }); test('focuses the content when opened', function(done) { - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { expect(document.activeElement).to.be.equal(content); done(); }); @@ -179,9 +173,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var focusableChild = Polymer.dom(content).querySelector('div[tabindex]'); dropdown.focusTarget = focusableChild; - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { expect(document.activeElement).to.not.be.equal(content); expect(document.activeElement).to.be.equal(focusableChild); done(); @@ -193,14 +185,40 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN suite('locking scroll', function() { var dropdown; + setup(function() { + dropdown = fixture('TrivialDropdown'); + }); + + test('should lock, only once', function(done) { + var openCount = 0; + runAfterOpen(dropdown, function() { + expect(Polymer.IronDropdownScrollManager._lockingElements.length) + .to.be.equal(1); + expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(document.body)) + .to.be.equal(true); + + if(openCount === 0) { + // This triggers a second `pushScrollLock` with the same element, however + // that should not add the element to the `_lockingElements` stack twice + dropdown.close(); + dropdown.open(); + } else { + done(); + } + openCount++; + }); + }); + }); + + suite('non locking scroll', function() { + var dropdown; + setup(function() { dropdown = fixture('NonLockingDropdown'); }); test('can be disabled with `allowOutsideScroll`', function(done) { - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { expect(Polymer.IronDropdownScrollManager.elementIsScrollLocked(document.body)) .to.be.equal(false); done(); @@ -219,9 +237,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var parentRect; var dropdownRect; - dropdown.opened = true; - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { dropdownRect = dropdown.getBoundingClientRect(); parentRect = parent.getBoundingClientRect(); @@ -230,7 +246,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN expect(dropdownRect.top).to.be.closeTo(parentRect.top, 0.1); expect(dropdownRect.right).to.be.closeTo(parentRect.right, 0.1); done(); - }, 1); + }); }); test('can be re-aligned to the bottom', function(done) { @@ -238,9 +254,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var dropdownRect; dropdown.verticalAlign = 'bottom'; - dropdown.opened = true; - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { parentRect = parent.getBoundingClientRect(); dropdownRect = dropdown.getBoundingClientRect(); @@ -249,7 +263,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN expect(dropdownRect.bottom).to.be.closeTo(parentRect.bottom, 0.1); expect(dropdownRect.right).to.be.closeTo(parentRect.right, 0.1); done(); - }, 1); + }); }); }); @@ -263,9 +277,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); test('can be offset towards the bottom right', function(done) { - dropdown.opened = true; - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { dropdownRect = dropdown.getBoundingClientRect(); dropdown.verticalOffset = 10; @@ -277,13 +289,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN // horizontalAlign is left, so a positive offset moves to the right. expect(dropdownRect.left + 10).to.be.closeTo(offsetDropdownRect.left, 0.1); done(); - }, 1); + }); }); test('can be offset towards the top left', function(done) { - dropdown.opened = true; - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { dropdownRect = dropdown.getBoundingClientRect(); dropdown.verticalOffset = -10; @@ -295,7 +305,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN // horizontalAlign is left, so a negative offset moves to the left. expect(dropdownRect.left - 10).to.be.closeTo(offsetDropdownRect.left, 0.1); done(); - }, 1); + }); }); }); @@ -309,9 +319,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); test('can be offset towards the top left', function(done) { - dropdown.opened = true; - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { dropdownRect = dropdown.getBoundingClientRect(); dropdown.verticalOffset = 10; @@ -323,13 +331,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN // horizontalAlign is right, so a positive offset moves to the left. expect(dropdownRect.right - 10).to.be.closeTo(offsetDropdownRect.right, 0.1); done(); - }, 1); + }); }); test('can be offset towards the bottom right', function(done) { - dropdown.opened = true; - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { dropdownRect = dropdown.getBoundingClientRect(); dropdown.verticalOffset = -10; @@ -341,7 +347,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN // horizontalAlign is right, so a positive offset moves to the right. expect(dropdownRect.right + 10).to.be.closeTo(offsetDropdownRect.right, 0.1); done(); - }, 1); + }); }); }); @@ -352,9 +358,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN test('with horizontalAlign=left', function(done) { var parent = fixture('RTLDropdownLeft'); dropdown = parent.querySelector('iron-dropdown'); - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { // In RTL, if `horizontalAlign` is "left", that's the same as // being right-aligned in LTR. So the dropdown should be in the top // right corner. @@ -368,9 +372,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN test('with horizontalAlign=right', function(done) { var parent = fixture('RTLDropdownRight'); dropdown = parent.querySelector('iron-dropdown'); - dropdown.open(); - - Polymer.Base.async(function() { + runAfterOpen(dropdown, function () { // In RTL, if `horizontalAlign` is "right", that's the same as // being left-aligned in LTR. So the dropdown should be in the top // left corner. diff --git a/dashboard-ui/bower_components/iron-dropdown/test/x-scrollable-element.html b/dashboard-ui/bower_components/iron-dropdown/test/x-scrollable-element.html new file mode 100644 index 0000000000..a3012e222d --- /dev/null +++ b/dashboard-ui/bower_components/iron-dropdown/test/x-scrollable-element.html @@ -0,0 +1,27 @@ + + + + + + + + diff --git a/dashboard-ui/bower_components/iron-flex-layout/.bower.json b/dashboard-ui/bower_components/iron-flex-layout/.bower.json index 0985b733c6..846bf5c150 100644 --- a/dashboard-ui/bower_components/iron-flex-layout/.bower.json +++ b/dashboard-ui/bower_components/iron-flex-layout/.bower.json @@ -28,14 +28,14 @@ "iron-component-page": "polymerelements/iron-component-page#^1.0.0" }, "ignore": [], - "homepage": "https://github.com/PolymerElements/iron-flex-layout", + "homepage": "https://github.com/polymerelements/iron-flex-layout", "_release": "1.2.2", "_resolution": { "type": "version", "tag": "v1.2.2", "commit": "41c4f35be1368afb770312b907a258175565dbdf" }, - "_source": "git://github.com/PolymerElements/iron-flex-layout.git", + "_source": "git://github.com/polymerelements/iron-flex-layout.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-flex-layout" + "_originalSource": "polymerelements/iron-flex-layout" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json index fb63745b7a..4ee51f4194 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-overlay-behavior", - "version": "1.2.0", + "version": "1.3.0", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, @@ -19,26 +19,25 @@ "url": "git://github.com/PolymerElements/iron-overlay-behavior.git" }, "dependencies": { - "polymer": "Polymer/polymer#^1.0.0", "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0", - "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0" + "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0", + "polymer": "Polymer/polymer#^1.0.0" }, "devDependencies": { - "paper-styles": "polymerelements/paper-styles#^1.0.2", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", + "paper-styles": "PolymerElements/paper-styles#^1.0.2", "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], "homepage": "https://github.com/polymerelements/iron-overlay-behavior", - "_release": "1.2.0", + "_release": "1.3.0", "_resolution": { "type": "version", - "tag": "v1.2.0", - "commit": "1d8e1d29c601add9c135e5103c4d1d0d652dd957" + "tag": "v1.3.0", + "commit": "b488ce94ec1c17c3a5491af1a2fba2f7382684da" }, "_source": "git://github.com/polymerelements/iron-overlay-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-overlay-behavior/CONTRIBUTING.md index 7b10141565..f147978a3e 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/CONTRIBUTING.md +++ b/dashboard-ui/bower_components/iron-overlay-behavior/CONTRIBUTING.md @@ -5,6 +5,11 @@ https://github.com/PolymerElements/ContributionGuide/blob/master/CONTRIBUTING.md If you edit that file, it will get updated everywhere else. If you edit this file, your changes will get overridden :) + +You can however override the jsbin link with one that's customized to this +specific element: + +jsbin=https://jsbin.com/cagaye/edit?html,output --> # Polymer Elements ## Guide for Contributors @@ -41,7 +46,7 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag 3. Click the `paper-foo` element. ``` - 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [http://jsbin.com/cagaye](http://jsbin.com/cagaye/edit?html,output). + 2. **A reduced test case that demonstrates the problem.** If possible, please include the test case as a JSBin. Start with this template to easily import and use relevant Polymer Elements: [https://jsbin.com/cagaye/edit?html,output](https://jsbin.com/cagaye/edit?html,output). 3. **A list of browsers where the problem occurs.** This can be skipped if the problem is the same across all browsers. @@ -51,14 +56,14 @@ Polymer Elements are built in the open, and the Polymer authors eagerly encourag When submitting pull requests, please provide: - 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues using the following syntax: + 1. **A reference to the corresponding issue** or issues that will be closed by the pull request. Please refer to these issues in the pull request description using the following syntax: ```markdown (For a single issue) Fixes #20 (For multiple issues) - Fixes #32, #40 + Fixes #32, fixes #40 ``` 2. **A succinct description of the design** used to fix any related issues. For example: diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json index e6f916d116..7a5aa4dc02 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-overlay-behavior", - "version": "1.2.0", + "version": "1.3.0", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, @@ -19,16 +19,15 @@ "url": "git://github.com/PolymerElements/iron-overlay-behavior.git" }, "dependencies": { - "polymer": "Polymer/polymer#^1.0.0", "iron-fit-behavior": "PolymerElements/iron-fit-behavior#^1.0.0", - "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0" + "iron-resizable-behavior": "PolymerElements/iron-resizable-behavior#^1.0.0", + "polymer": "Polymer/polymer#^1.0.0" }, "devDependencies": { - "paper-styles": "polymerelements/paper-styles#^1.0.2", "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", "iron-flex-layout": "PolymerElements/iron-flex-layout#^1.0.0", "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", + "paper-styles": "PolymerElements/paper-styles#^1.0.2", "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html b/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html index c58158ef1d..c14f7ae45f 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/demo/index.html @@ -120,7 +120,10 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - Hello world! +

Hello world!

+ + +
diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html index 5a5e24b5eb..1eb3c2f596 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-backdrop.html @@ -118,10 +118,14 @@ Custom property | Description | Default this.style.zIndex = this._manager.backdropZ(); // close only if no element with backdrop is left if (this._manager.getBackdrops().length === 0) { + // Read style before setting opened. + var cs = getComputedStyle(this); + var noAnimation = (cs.transitionDuration === '0s' || cs.opacity == 0); this._setOpened(false); - // complete() will be called after the transition is done. - // If animations are disabled via custom-styles, user is expected to call - // complete() after close() + // In case of no animations, complete + if (noAnimation) { + this.complete(); + } } }, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html index afa489f537..cd5eb4297d 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-behavior.html @@ -135,6 +135,18 @@ context. You should place this element as a child of `` whenever possible. value: function() { return this._onCaptureKeydown.bind(this); } + }, + + _boundOnCaptureFocus: { + type: Function, + value: function() { + return this._onCaptureFocus.bind(this); + } + }, + + /** @type {?Node} */ + _focusedChild: { + type: Object } }, @@ -152,10 +164,13 @@ context. You should place this element as a child of `` whenever possible. }, get _focusNode() { - return Polymer.dom(this).querySelector('[autofocus]') || this; + return this._focusedChild || Polymer.dom(this).querySelector('[autofocus]') || this; }, ready: function() { + // with-backdrop need tabindex to be set in order to trap the focus. + // If it is not set, IronOverlayBehavior will set it, and remove it if with-backdrop = false. + this.__shouldRemoveTabIndex = false; this._ensureSetup(); }, @@ -265,6 +280,14 @@ context. You should place this element as a child of `` whenever possible. }, _withBackdropChanged: function() { + // If tabindex is already set, no need to override it. + if (this.withBackdrop && !this.hasAttribute('tabindex')) { + this.setAttribute('tabindex', '-1'); + this.__shouldRemoveTabIndex = true; + } else if (this.__shouldRemoveTabIndex) { + this.removeAttribute('tabindex'); + this.__shouldRemoveTabIndex = false; + } if (this.opened) { this._manager.trackBackdrop(this); if (this.withBackdrop) { @@ -298,6 +321,7 @@ context. You should place this element as a child of `` whenever possible. _toggleListeners: function () { this._toggleListener(this.opened, document, 'tap', this._boundOnCaptureClick, true); this._toggleListener(this.opened, document, 'keydown', this._boundOnCaptureKeydown, true); + this._toggleListener(this.opened, document, 'focus', this._boundOnCaptureFocus, true); }, // tasks which must occur before opening; e.g. making the element visible @@ -343,6 +367,7 @@ context. You should place this element as a child of `` whenever possible. this.style.display = 'none'; this._manager.removeOverlay(this); + this._focusedChild = null; this._applyFocus(); this.notifyResize(); @@ -376,9 +401,12 @@ context. You should place this element as a child of `` whenever possible. _onCaptureClick: function(event) { if (this._manager.currentOverlay() === this && - !this.noCancelOnOutsideClick && Polymer.dom(event).path.indexOf(this) === -1) { - this.cancel(); + if (this.noCancelOnOutsideClick) { + this._applyFocus(); + } else { + this.cancel(); + } } }, @@ -391,6 +419,19 @@ context. You should place this element as a child of `` whenever possible. } }, + _onCaptureFocus: function (event) { + if (this._manager.currentOverlay() === this && + this.withBackdrop) { + var path = Polymer.dom(event).path; + if (path.indexOf(this) === -1) { + event.stopPropagation(); + this._applyFocus(); + } else { + this._focusedChild = path[0]; + } + } + }, + _onIronResize: function() { if (this.opened) { this.refit(); diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html index 30d5f03b60..47d410f798 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/test/iron-overlay-behavior.html @@ -323,6 +323,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); }); + test('no-cancel-on-outside-click property; focus stays on overlay when click outside', function(done) { + overlay = fixture('autofocus'); + overlay.noCancelOnOutsideClick = true; + runAfterOpen(overlay, function() { + MockInteractions.tap(document.body); + setTimeout(function() { + assert.equal(Polymer.dom(overlay).querySelector('[autofocus]'), document.activeElement, '