diff --git a/dashboard-ui/advanced.html b/dashboard-ui/advanced.html index 2b991cc0d..77f5379cd 100644 --- a/dashboard-ui/advanced.html +++ b/dashboard-ui/advanced.html @@ -4,7 +4,7 @@ ${TitleAdvanced} -
+
diff --git a/dashboard-ui/autoorganizelog.html b/dashboard-ui/autoorganizelog.html index 419774564..890cedbda 100644 --- a/dashboard-ui/autoorganizelog.html +++ b/dashboard-ui/autoorganizelog.html @@ -12,7 +12,6 @@
@@ -79,7 +78,7 @@
${LabelEndingEpisodeNumberHelp}

-
+
${OptionRememberOrganizeCorrection}

diff --git a/dashboard-ui/autoorganizetv.html b/dashboard-ui/autoorganizetv.html index f5646f541..e9d2d44d8 100644 --- a/dashboard-ui/autoorganizetv.html +++ b/dashboard-ui/autoorganizetv.html @@ -4,14 +4,13 @@ ${TitleAutoOrganize} -
+
diff --git a/dashboard-ui/bower_components/iron-menu-behavior/.bower.json b/dashboard-ui/bower_components/iron-menu-behavior/.bower.json index affa4a3cf..6b8707e18 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-menu-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "iron-menu-behavior", - "version": "1.1.0", + "version": "1.1.1", "description": "Provides accessible menu behavior", "authors": "The Polymer Authors", "keywords": [ @@ -34,11 +34,11 @@ "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "_release": "1.1.0", + "_release": "1.1.1", "_resolution": { "type": "version", - "tag": "v1.1.0", - "commit": "b18d5478f1d4d6befb15533716d60d5772f8e812" + "tag": "v1.1.1", + "commit": "0fc2c95803badd8e8f50cbe7f5d3669d647e7229" }, "_source": "git://github.com/polymerelements/iron-menu-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-menu-behavior/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-menu-behavior/CONTRIBUTING.md index 7b1014156..f147978a3 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/CONTRIBUTING.md +++ b/dashboard-ui/bower_components/iron-menu-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-menu-behavior/bower.json b/dashboard-ui/bower_components/iron-menu-behavior/bower.json index 515df8175..8bb7ada8f 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/bower.json +++ b/dashboard-ui/bower_components/iron-menu-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "iron-menu-behavior", - "version": "1.1.0", + "version": "1.1.1", "description": "Provides accessible menu behavior", "authors": "The Polymer Authors", "keywords": [ diff --git a/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html index 82da111de..2a5e549d1 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html +++ b/dashboard-ui/bower_components/iron-menu-behavior/iron-menu-behavior.html @@ -239,6 +239,13 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN return; } + // Do not focus the selected tab if the deepest target is part of the + // menu element's local DOM and is focusable. + var rootTarget = Polymer.dom(event).rootTarget; + if (rootTarget !== this && typeof rootTarget.tabIndex !== "undefined" && !this.isLightDescendant(rootTarget)) { + return; + } + this.blur(); // clear the cached focus item diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html index 32fb203f1..d7bb21614 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html +++ b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menu-behavior.html @@ -72,7 +72,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN var menu = fixture('basic'); MockInteractions.focus(menu); setTimeout(function() { - assert.equal(document.activeElement, menu.firstElementChild, 'document.activeElement is first item') + var ownerRoot = Polymer.dom(menu.firstElementChild).getOwnerRoot() || document; + var activeElement = Polymer.dom(ownerRoot).activeElement; + assert.equal(activeElement, menu.firstElementChild, 'menu.firstElementChild is focused'); done(); // wait for async in _onFocus }, 200); @@ -83,7 +85,22 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN menu.selected = 1; MockInteractions.focus(menu); setTimeout(function() { - assert.equal(document.activeElement, menu.selectedItem, 'document.activeElement is selected item'); + var ownerRoot = Polymer.dom(menu.selectedItem).getOwnerRoot() || document; + var activeElement = Polymer.dom(ownerRoot).activeElement; + assert.equal(activeElement, menu.selectedItem, 'menu.selectedItem is focused'); + done(); + // wait for async in _onFocus + }, 200); + }); + + test('focusing non-item content does not auto-focus an item', function(done) { + var menu = fixture('basic'); + menu.extraContent.focus(); + setTimeout(function() { + var menuOwnerRoot = Polymer.dom(menu.extraContent).getOwnerRoot() || document; + var menuActiveElement = Polymer.dom(menuOwnerRoot).activeElement; + assert.equal(menuActiveElement, menu.extraContent, 'menu.extraContent is focused'); + assert.equal(Polymer.dom(document).activeElement, menu, 'menu is document.activeElement'); done(); // wait for async in _onFocus }, 200); @@ -94,7 +111,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN menu.selected = 0; menu.items[1].click(); setTimeout(function() { - assert.equal(document.activeElement, menu.items[1], 'document.activeElement is last activated item'); + var ownerRoot = Polymer.dom(menu.items[1]).getOwnerRoot() || document; + var activeElement = Polymer.dom(ownerRoot).activeElement; + assert.equal(activeElement, menu.items[1], 'menu.items[1] is focused'); done(); // wait for async in _onFocus }, 200); @@ -105,7 +124,9 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN menu.selected = 0; menu.items[0].click(); setTimeout(function() { - assert.equal(document.activeElement, menu.items[0], 'document.activeElement is last activated item'); + var ownerRoot = Polymer.dom(menu.items[0]).getOwnerRoot() || document; + var activeElement = Polymer.dom(ownerRoot).activeElement; + assert.equal(activeElement, menu.items[0], 'menu.items[0] is focused'); done(); // wait for async in _onFocus }, 200); diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html index 2be806b86..dac9e9b68 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html +++ b/dashboard-ui/bower_components/iron-menu-behavior/test/iron-menubar-behavior.html @@ -87,6 +87,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, 200); }); + test('focusing non-item content does not auto-focus an item', function(done) { + var menubar = fixture('basic'); + menubar.extraContent.focus(); + setTimeout(function() { + var ownerRoot = Polymer.dom(menubar.extraContent).getOwnerRoot() || document; + var activeElement = Polymer.dom(ownerRoot).activeElement; + assert.equal(activeElement, menubar.extraContent, 'menubar.extraContent is focused'); + assert.equal(Polymer.dom(document).activeElement, menubar, 'menubar is document.activeElement'); + done(); + // wait for async in _onFocus + }, 200); + }); + test('last activated item in a multi select menubar is focused', function(done) { var menubar = fixture('multi'); menubar.selected = 0; diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html index 19b166214..aa8eab288 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html +++ b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menu.html @@ -17,6 +17,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN +
focusable extra content
+ @@ -31,7 +33,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN behaviors: [ Polymer.IronMenuBehavior - ] + ], + + get extraContent() { + return this.$.extraContent; + } }); diff --git a/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html index 5f7ecbcdb..66ce6fdec 100644 --- a/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html +++ b/dashboard-ui/bower_components/iron-menu-behavior/test/test-menubar.html @@ -17,6 +17,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN +
focusable extra content
+ @@ -31,7 +33,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN behaviors: [ Polymer.IronMenubarBehavior - ] + ], + + get extraContent() { + return this.$.extraContent; + } }); diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/.bower.json index 4ee51f419..1de4c2848 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.3.0", + "version": "1.3.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, @@ -33,11 +33,11 @@ }, "ignore": [], "homepage": "https://github.com/polymerelements/iron-overlay-behavior", - "_release": "1.3.0", + "_release": "1.3.1", "_resolution": { "type": "version", - "tag": "v1.3.0", - "commit": "b488ce94ec1c17c3a5491af1a2fba2f7382684da" + "tag": "v1.3.1", + "commit": "efaa64da9dbaa4209483c2d9fd7bf3bd20beb5e2" }, "_source": "git://github.com/polymerelements/iron-overlay-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/bower.json b/dashboard-ui/bower_components/iron-overlay-behavior/bower.json index 7a5aa4dc0..4898a6836 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.3.0", + "version": "1.3.1", "license": "http://polymer.github.io/LICENSE.txt", "description": "Provides a behavior for making an element an overlay", "private": true, diff --git a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html index 7eeb13d08..094a89e11 100644 --- a/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html +++ b/dashboard-ui/bower_components/iron-overlay-behavior/iron-overlay-manager.html @@ -26,6 +26,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN this._minimumZ = 101; this._backdrops = []; + + this._backdropElement = null; + Object.defineProperty(this, 'backdropElement', { + get: function() { + if (!this._backdropElement) { + this._backdropElement = document.createElement('iron-overlay-backdrop'); + } + return this._backdropElement; + }.bind(this) + }); } Polymer.IronOverlayManagerClass.prototype._applyOverlayZ = function(overlay, aboveZ) { @@ -107,15 +117,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN } }; - Object.defineProperty(Polymer.IronOverlayManagerClass.prototype, "backdropElement", { - get: function() { - if (!this._backdropElement) { - this._backdropElement = document.createElement('iron-overlay-backdrop'); - } - return this._backdropElement; - } - }); - Polymer.IronOverlayManagerClass.prototype.getBackdrops = function() { return this._backdrops; }; diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json b/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json index 4023c89b7..6bb6ad46d 100644 --- a/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json +++ b/dashboard-ui/bower_components/paper-dialog-behavior/.bower.json @@ -1,6 +1,6 @@ { "name": "paper-dialog-behavior", - "version": "1.1.1", + "version": "1.2.0", "description": "Implements a behavior used for material design dialogs", "authors": "The Polymer Authors", "keywords": [ @@ -26,17 +26,19 @@ }, "devDependencies": { "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", "paper-button": "PolymerElements/paper-button#^1.0.0", "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", + "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0", "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, - "_release": "1.1.1", + "_release": "1.2.0", "_resolution": { "type": "version", - "tag": "v1.1.1", - "commit": "5831039e9f878c63478064abed115c98992b5504" + "tag": "v1.2.0", + "commit": "a3be07d2784073d5e9e5175fb7d13f7b1f2a5558" }, "_source": "git://github.com/PolymerElements/paper-dialog-behavior.git", "_target": "^1.0.0", diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/CONTRIBUTING.md b/dashboard-ui/bower_components/paper-dialog-behavior/CONTRIBUTING.md index 7b1014156..f147978a3 100644 --- a/dashboard-ui/bower_components/paper-dialog-behavior/CONTRIBUTING.md +++ b/dashboard-ui/bower_components/paper-dialog-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/paper-dialog-behavior/bower.json b/dashboard-ui/bower_components/paper-dialog-behavior/bower.json index 7d231ca9c..f95a6deb8 100644 --- a/dashboard-ui/bower_components/paper-dialog-behavior/bower.json +++ b/dashboard-ui/bower_components/paper-dialog-behavior/bower.json @@ -1,6 +1,6 @@ { "name": "paper-dialog-behavior", - "version": "1.1.1", + "version": "1.2.0", "description": "Implements a behavior used for material design dialogs", "authors": "The Polymer Authors", "keywords": [ @@ -26,9 +26,11 @@ }, "devDependencies": { "iron-component-page": "PolymerElements/iron-component-page#^1.0.0", + "iron-demo-helpers": "PolymerElements/iron-demo-helpers#^1.0.0", + "iron-test-helpers": "PolymerElements/iron-test-helpers#^1.0.0", "paper-button": "PolymerElements/paper-button#^1.0.0", "paper-dialog-scrollable": "PolymerElements/paper-dialog-scrollable#^1.0.0", - "test-fixture": "PolymerElements/test-fixture#^1.0.0", + "paper-icon-button": "PolymerElements/paper-icon-button#^1.0.0", "web-component-tester": "^4.0.0", "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" } diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html b/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html index d1957c48c..7d9e2f4c1 100644 --- a/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html +++ b/dashboard-ui/bower_components/paper-dialog-behavior/demo/index.html @@ -21,83 +21,72 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - + + - + - + -
- - - - -

Dialog Title

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

-
- - - - -

Alert

-

Discard draft?

-
- More details - Cancel - Discard -
-
- - -

Details

-

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

- OK -
- - - - -

Scrolling

- +

An element with PaperDialogBehavior can be opened, closed, toggled. Use h2 for the title

+ + + -
+

An element with PaperDialogBehavior can be modal. Use the attributes dialog-dismiss and dialog-confirm on the children to close it.

+ + + - +

Use paper-dialog-scrollable for scrolling content

+ + + diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html b/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html index 3bc948cc0..137709956 100644 --- a/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html +++ b/dashboard-ui/bower_components/paper-dialog-behavior/paper-dialog-behavior.html @@ -77,39 +77,28 @@ The `aria-labelledby` attribute will be set to the header element, if one exists properties: { /** - * If `modal` is true, this implies `no-cancel-on-outside-click` and `with-backdrop`. + * If `modal` is true, this implies `no-cancel-on-outside-click`, `no-cancel-on-esc-key` and `with-backdrop`. */ modal: { - observer: '_modalChanged', type: Boolean, value: false - }, - - /** @type {?Node} */ - _lastFocusedElement: { - type: Object - }, - - _boundOnFocus: { - type: Function, - value: function() { - return this._onFocus.bind(this); - } - }, - - _boundOnBackdropClick: { - type: Function, - value: function() { - return this._onBackdropClick.bind(this); - } } }, + observers: [ + '_modalChanged(modal, _readied)' + ], + listeners: { - 'tap': '_onDialogClick', - 'iron-overlay-opened': '_onIronOverlayOpened', - 'iron-overlay-closed': '_onIronOverlayClosed' + 'tap': '_onDialogClick' + }, + + ready: function () { + // Only now these properties can be read. + this.__prevNoCancelOnOutsideClick = this.noCancelOnOutsideClick; + this.__prevNoCancelOnEscKey = this.noCancelOnEscKey; + this.__prevWithBackdrop = this.withBackdrop; }, attached: function() { @@ -122,17 +111,34 @@ The `aria-labelledby` attribute will be set to the header element, if one exists Polymer.dom(this).unobserveNodes(this._ariaObserver); }, - _modalChanged: function() { - if (this.modal) { + _modalChanged: function(modal, readied) { + if (modal) { this.setAttribute('aria-modal', 'true'); } else { this.setAttribute('aria-modal', 'false'); } - // modal implies noCancelOnOutsideClick and withBackdrop if true, don't overwrite - // those properties otherwise. - if (this.modal) { + + // modal implies noCancelOnOutsideClick, noCancelOnEscKey and withBackdrop. + // We need to wait for the element to be ready before we can read the + // properties values. + if (!readied) { + return; + } + + if (modal) { + this.__prevNoCancelOnOutsideClick = this.noCancelOnOutsideClick; + this.__prevNoCancelOnEscKey = this.noCancelOnEscKey; + this.__prevWithBackdrop = this.withBackdrop; this.noCancelOnOutsideClick = true; + this.noCancelOnEscKey = true; this.withBackdrop = true; + } else { + // If the value was changed to false, let it false. + this.noCancelOnOutsideClick = this.noCancelOnOutsideClick && + this.__prevNoCancelOnOutsideClick; + this.noCancelOnEscKey = this.noCancelOnEscKey && + this.__prevNoCancelOnEscKey; + this.withBackdrop = this.withBackdrop && this.__prevWithBackdrop; } }, @@ -162,57 +168,21 @@ The `aria-labelledby` attribute will be set to the header element, if one exists this.closingReason.confirmed = confirmed; }, + /** + * Will dismiss the dialog if user clicked on an element with dialog-dismiss + * or dialog-confirm attribute. + */ _onDialogClick: function(event) { - var target = Polymer.dom(event).rootTarget; - while (target && target !== this) { - if (target.hasAttribute) { - if (target.hasAttribute('dialog-dismiss')) { - this._updateClosingReasonConfirmed(false); - this.close(); - event.stopPropagation(); - break; - } else if (target.hasAttribute('dialog-confirm')) { - this._updateClosingReasonConfirmed(true); - this.close(); - event.stopPropagation(); - break; - } - } - target = Polymer.dom(target).parentNode; - } - }, - - _onIronOverlayOpened: function() { - if (this.modal) { - document.body.addEventListener('focus', this._boundOnFocus, true); - document.body.addEventListener('click', this._boundOnBackdropClick, true); - } - }, - - _onIronOverlayClosed: function() { - this._lastFocusedElement = null; - document.body.removeEventListener('focus', this._boundOnFocus, true); - document.body.removeEventListener('click', this._boundOnBackdropClick, true); - }, - - _onFocus: function(event) { - if (this.modal && this._manager.currentOverlay() === this) { - if (Polymer.dom(event).path.indexOf(this) !== -1) { - this._lastFocusedElement = event.target; - } else if (this._lastFocusedElement) { - this._lastFocusedElement.focus(); - } else { - this._focusNode.focus(); - } - } - }, - - _onBackdropClick: function(event) { - if (this.modal && this._manager.currentOverlay() === this && Polymer.dom(event).path.indexOf(this) === -1) { - if (this._lastFocusedElement) { - this._lastFocusedElement.focus(); - } else { - this._focusNode.focus(); + // Search for the element with dialog-confirm or dialog-dismiss, + // from the root target until this (excluded). + var path = Polymer.dom(event).path; + for (var i = 0; i < path.indexOf(this); i++) { + var target = path[i]; + if (target.hasAttribute && (target.hasAttribute('dialog-dismiss') || target.hasAttribute('dialog-confirm'))) { + this._updateClosingReasonConfirmed(target.hasAttribute('dialog-confirm')); + this.close(); + event.stopPropagation(); + break; } } } diff --git a/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html b/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html index ec735b235..735ec67c7 100644 --- a/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html +++ b/dashboard-ui/bower_components/paper-dialog-behavior/test/paper-dialog-behavior.html @@ -9,6 +9,7 @@ Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> + paper-dialog-behavior tests @@ -18,15 +19,16 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN - - - + + + + @@ -51,6 +53,19 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + + + + - + @@ -132,6 +143,12 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN + diff --git a/dashboard-ui/components/guestinviter/guestinviter.js b/dashboard-ui/components/guestinviter/guestinviter.js index 47655d8c5..83e2c229c 100644 --- a/dashboard-ui/components/guestinviter/guestinviter.js +++ b/dashboard-ui/components/guestinviter/guestinviter.js @@ -111,7 +111,7 @@ dlg.innerHTML = html; // needed for the collapsible document.body.appendChild(dlg); - $(dlg).trigger('create'); + $(dlg.querySelector('form')).trigger('create'); paperDialogHelper.open(dlg); diff --git a/dashboard-ui/components/subtitleeditor/subtitleeditor.js b/dashboard-ui/components/subtitleeditor/subtitleeditor.js index d7e908f12..933e448ee 100644 --- a/dashboard-ui/components/subtitleeditor/subtitleeditor.js +++ b/dashboard-ui/components/subtitleeditor/subtitleeditor.js @@ -297,14 +297,27 @@ }); } - function reload(page, itemId) { + function reload(context, itemId) { - $('.noSearchResults', page).hide(); + $('.noSearchResults', context).hide(); function onGetItem(item) { currentItem = item; - fillSubtitleList(page, item); + fillSubtitleList(context, item); + var file = item.Path || ''; + var index = Math.max(file.lastIndexOf('/'), file.lastIndexOf('\\')); + if (index > -1) { + file = file.substring(index + 1); + } + + if (file) { + context.querySelector('.pathValue').innerHTML = file; + context.querySelector('.originalFile').classList.remove('hide'); + } else { + context.querySelector('.pathValue').innerHTML = ''; + context.querySelector('.originalFile').classList.add('hide'); + } Dashboard.hideLoadingMsg(); } @@ -362,6 +375,8 @@ dlg.innerHTML = html; document.body.appendChild(dlg); + dlg.querySelector('.pathLabel').innerHTML = Globalize.translate('MediaInfoFile'); + $('.subtitleSearchForm', dlg).off('submit', onSearchSubmit).on('submit', onSearchSubmit); paperDialogHelper.open(dlg); diff --git a/dashboard-ui/components/subtitleeditor/subtitleeditor.template.html b/dashboard-ui/components/subtitleeditor/subtitleeditor.template.html index eee194ab8..74cca8296 100644 --- a/dashboard-ui/components/subtitleeditor/subtitleeditor.template.html +++ b/dashboard-ui/components/subtitleeditor/subtitleeditor.template.html @@ -5,6 +5,8 @@

${HeaderSearchForSubtitles}

+

+
diff --git a/dashboard-ui/devicesupload.html b/dashboard-ui/devicesupload.html index 44218a4d3..045c3ff6f 100644 --- a/dashboard-ui/devicesupload.html +++ b/dashboard-ui/devicesupload.html @@ -4,7 +4,7 @@ ${TitleDevices} -
+
diff --git a/dashboard-ui/dlnaprofile.html b/dashboard-ui/dlnaprofile.html index 801a5e494..b33613b8c 100644 --- a/dashboard-ui/dlnaprofile.html +++ b/dashboard-ui/dlnaprofile.html @@ -4,7 +4,7 @@ ${TitleDlna} -
+
@@ -406,7 +406,7 @@
-
+