diff --git a/dashboard-ui/bower_components/emby-webcomponents/.bower.json b/dashboard-ui/bower_components/emby-webcomponents/.bower.json index b13c727a11..101f692eea 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.4.14", - "_release": "1.4.14", + "version": "1.4.15", + "_release": "1.4.15", "_resolution": { "type": "version", - "tag": "1.4.14", - "commit": "fd21288c33a836206b3f6322cd3205f63c2db53f" + "tag": "1.4.15", + "commit": "0a71ddc9b55b812fb7c7059525a6a774c3423996" }, "_source": "https://github.com/MediaBrowser/emby-webcomponents.git", "_target": "^1.2.0", diff --git a/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js b/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js index 080dd1916e..0dcd7f9b6c 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js +++ b/dashboard-ui/bower_components/emby-webcomponents/viewmanager/viewmanager.js @@ -176,6 +176,10 @@ define(['viewcontainer', 'focusManager', 'queryString', 'connectionManager', 'ev }); }; + self.currentView = function () { + return currentView; + }; + self.dispatchPageEvents = function (value) { dispatchPageEvents = value; }; diff --git a/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json b/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json index 1baafa9707..d0996a0614 100644 --- a/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json +++ b/dashboard-ui/bower_components/iron-a11y-announcer/.bower.json @@ -30,14 +30,14 @@ "web-component-tester": "polymer/web-component-tester#^3.4.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-a11y-announcer", + "homepage": "https://github.com/PolymerElements/iron-a11y-announcer", "_release": "1.0.4", "_resolution": { "type": "version", "tag": "v1.0.4", "commit": "5ce3eb8c4282bb53cd72e348858dc6be6b4c50b9" }, - "_source": "git://github.com/polymerelements/iron-a11y-announcer.git", + "_source": "git://github.com/PolymerElements/iron-a11y-announcer.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-a11y-announcer" + "_originalSource": "PolymerElements/iron-a11y-announcer" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json index 9604c48b0b..f920799d20 100644 --- a/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-a11y-keys-behavior/.bower.json @@ -30,14 +30,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/PolymerElements/iron-a11y-keys-behavior", + "homepage": "https://github.com/polymerelements/iron-a11y-keys-behavior", "_release": "1.1.2", "_resolution": { "type": "version", "tag": "v1.1.2", "commit": "0c2330c229a6fd3d200e2b84147ec6f94f17c22d" }, - "_source": "git://github.com/PolymerElements/iron-a11y-keys-behavior.git", + "_source": "git://github.com/polymerelements/iron-a11y-keys-behavior.git", "_target": "^1.0.0", - "_originalSource": "PolymerElements/iron-a11y-keys-behavior" + "_originalSource": "polymerelements/iron-a11y-keys-behavior" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-icon/.bower.json b/dashboard-ui/bower_components/iron-icon/.bower.json index f0167baf13..9784e3a3b7 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-list/.bower.json b/dashboard-ui/bower_components/iron-list/.bower.json index 2fdd80b9f4..1808c0865f 100644 --- a/dashboard-ui/bower_components/iron-list/.bower.json +++ b/dashboard-ui/bower_components/iron-list/.bower.json @@ -7,7 +7,7 @@ "list", "virtual-list" ], - "version": "1.3.1", + "version": "1.3.2", "homepage": "https://github.com/PolymerElements/iron-list", "authors": [ "The Polymer Authors" @@ -45,14 +45,13 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.2", "web-component-tester": "^4.0.0" }, - "_release": "1.3.1", + "_release": "1.3.2", "_resolution": { "type": "version", - "tag": "v1.3.1", - "commit": "094724304d9df8c1c9cc5a8e62b9b607d4a0b86c" + "tag": "v1.3.2", + "commit": "5e6f1991f0b8f427b8432ce9538f3b100402545c" }, "_source": "git://github.com/PolymerElements/iron-list.git", "_target": "^1.3.1", - "_originalSource": "PolymerElements/iron-list", - "_direct": true + "_originalSource": "PolymerElements/iron-list" } \ No newline at end of file diff --git a/dashboard-ui/bower_components/iron-list/CONTRIBUTING.md b/dashboard-ui/bower_components/iron-list/CONTRIBUTING.md index f147978a3e..093090d435 100644 --- a/dashboard-ui/bower_components/iron-list/CONTRIBUTING.md +++ b/dashboard-ui/bower_components/iron-list/CONTRIBUTING.md @@ -1,4 +1,3 @@ - + # Polymer Elements ## Guide for Contributors diff --git a/dashboard-ui/bower_components/iron-list/bower.json b/dashboard-ui/bower_components/iron-list/bower.json index ca0515e3dc..53cf947498 100644 --- a/dashboard-ui/bower_components/iron-list/bower.json +++ b/dashboard-ui/bower_components/iron-list/bower.json @@ -7,7 +7,7 @@ "list", "virtual-list" ], - "version": "1.3.1", + "version": "1.3.2", "homepage": "https://github.com/PolymerElements/iron-list", "authors": [ "The Polymer Authors" diff --git a/dashboard-ui/bower_components/iron-list/iron-list.html b/dashboard-ui/bower_components/iron-list/iron-list.html index 4a2d912c49..37f7822830 100644 --- a/dashboard-ui/bower_components/iron-list/iron-list.html +++ b/dashboard-ui/bower_components/iron-list/iron-list.html @@ -620,7 +620,6 @@ will only render 20. if (physicalOffset > this._scrollPosition) { return this.grid ? vidx - (vidx % this._itemsPerRow) : vidx; } - // Handle a partially rendered final row in grid mode if (this.grid && this._virtualCount - 1 === vidx) { return vidx - (vidx % this._itemsPerRow); @@ -639,21 +638,17 @@ will only render 20. if (this._lastVisibleIndexVal === null) { if (this.grid) { var lastIndex = this.firstVisibleIndex + this._estRowsInView * this._itemsPerRow - 1; - this._lastVisibleIndexVal = lastIndex > this._virtualCount ? this._virtualCount : lastIndex; + this._lastVisibleIndexVal = Math.min(this._virtualCount, lastIndex); } else { var physicalOffset = this._physicalTop; - this._iterateItems(function(pidx, vidx) { - physicalOffset += this._getPhysicalSizeIncrement(pidx); - - if(physicalOffset <= this._scrollBottom) { - if (this.grid) { - var lastIndex = vidx - vidx % this._itemsPerRow + this._itemsPerRow - 1; - this._lastVisibleIndexVal = lastIndex > this._virtualCount ? this._virtualCount : lastIndex; - } else { - this._lastVisibleIndexVal = vidx; - } + if (physicalOffset < this._scrollBottom) { + this._lastVisibleIndexVal = vidx; + } else { + // Break _iterateItems + return true; } + physicalOffset += this._getPhysicalSizeIncrement(pidx); }); } } @@ -1067,10 +1062,11 @@ will only render 20. this._virtualCount = this.items ? this.items.length : 0; this._collection = this.items ? Polymer.Collection.get(this.items) : null; this._physicalIndexForKey = {}; + this._firstVisibleIndexVal = null; + this._lastVisibleIndexVal = null; this._resetScrollPosition(0); this._removeFocusedItem(); - // create the initial physical items if (!this._physicalItems) { this._physicalCount = Math.max(1, Math.min(DEFAULT_PHYSICAL_COUNT, this._virtualCount)); @@ -1081,6 +1077,7 @@ will only render 20. this._physicalStart = 0; } else if (change.path === 'items.splices') { + this._adjustVirtualIndex(change.value.indexSplices); this._virtualCount = this.items ? this.items.length : 0; @@ -1313,7 +1310,7 @@ will only render 20. if (deltaHeight) { this._physicalTop = this._physicalTop - deltaHeight; // juking scroll position during interial scrolling on iOS is no bueno - if (!IOS_TOUCH_SCROLLING) { + if (!IOS_TOUCH_SCROLLING && this._physicalTop !== 0) { this._resetScrollPosition(this._scrollTop - deltaHeight); } } diff --git a/dashboard-ui/bower_components/iron-list/test/basic.html b/dashboard-ui/bower_components/iron-list/test/basic.html index c2ef4578a7..7ebcc68d76 100644 --- a/dashboard-ui/bower_components/iron-list/test/basic.html +++ b/dashboard-ui/bower_components/iron-list/test/basic.html @@ -81,55 +81,44 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }); }); - test('first visible index', function(done) { + test('first visible index', function() { container.data = buildDataSet(100); + Polymer.dom.flush(); + assert.equal(list.firstVisibleIndex, 0); + list.scroll(0, container.itemHeight * 10); + list.fire('scroll'); + assert.equal(list.firstVisibleIndex, 10); + list.scroll(0, container.itemHeight * 50); + list.fire('scroll'); + assert.equal(list.firstVisibleIndex, 50); + list.scrollToIndex(60); + Polymer.dom.flush(); + assert.equal(list.firstVisibleIndex, 60); + list.scrollToIndex(0); + Polymer.dom.flush(); + assert.equal(list.firstVisibleIndex, 0); + }); - flush(function() { - var setSize = list.items.length; - var rowHeight = container.itemHeight; - var viewportHeight = list.offsetHeight; - var scrollToItem; - - function checkFirstVisible() { - assert.equal(list.firstVisibleIndex, scrollToItem); - assert.equal(getFirstItemFromList(list).textContent, scrollToItem); - } - - function checkLastVisible() { - var visibleItemsCount = Math.floor(viewportHeight / rowHeight); - assert.equal(list.lastVisibleIndex, scrollToItem + visibleItemsCount - 1); - assert.equal(getLastItemFromList(list).textContent, scrollToItem + visibleItemsCount - 1); - } - - function doneScrollDown() { - checkFirstVisible(); - checkLastVisible(); - scrollToItem = 1; - flush(function() { - simulateScroll({ - list: list, - contribution: rowHeight, - target: scrollToItem*rowHeight, - onScrollEnd: doneScrollUp - }); - }); - } - - function doneScrollUp() { - checkFirstVisible(); - checkLastVisible(); - done(); - } - scrollToItem = 50; - - simulateScroll({ - list: list, - contribution: 50, - target: scrollToItem*rowHeight, - onScrollEnd: doneScrollDown - }); - - }); + test('last visible index', function() { + container.data = buildDataSet(1); + container.itemHeight = 1000; + Polymer.dom.flush(); + assert.equal(list.lastVisibleIndex, 0); + container.data = buildDataSet(2); + container.itemHeight = 50; + Polymer.dom.flush(); + assert.equal(list.lastVisibleIndex, 1); + container.data = buildDataSet(10); + Polymer.dom.flush(); + list.scrollToIndex(8); + Polymer.dom.flush(); + assert.equal(list.lastVisibleIndex, 9); + container.itemHeight = 50; + container.data = buildDataSet(100); + Polymer.dom.flush(); + list.scroll(0, 100); + list.fire('scroll'); + assert.equal(list.lastVisibleIndex, ((list._scrollTop + container.listHeight) / container.itemHeight) - 1); }); test('scroll to index', function(done) { @@ -161,6 +150,30 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN }, 100); }); + test('scroll to top', function(done) { + list.items = buildDataSet(100); + Polymer.dom.flush(); + list.scrollToIndex(99); + Polymer.dom.flush(); + list.scroll(0, 0); + setTimeout(function() { + assert.equal(list._scrollTop, 0, 'scrollTop = 0'); + done(); + }, 100); + }); + + test('scroll to a given scrollTop', function(done) { + list.items = buildDataSet(100); + Polymer.dom.flush(); + list.scrollToIndex(99); + Polymer.dom.flush(); + list.scroll(0, 500); + setTimeout(function() { + assert.equal(list._scrollTop, 500, 'scrollTop = 500'); + done(); + }, 100); + }); + test('reset items', function(done) { list.items = buildDataSet(100); diff --git a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json index cca11d8994..2e765b9324 100644 --- a/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json +++ b/dashboard-ui/bower_components/iron-resizable-behavior/.bower.json @@ -28,14 +28,14 @@ "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.0" }, "ignore": [], - "homepage": "https://github.com/polymerelements/iron-resizable-behavior", + "homepage": "https://github.com/PolymerElements/iron-resizable-behavior", "_release": "1.0.3", "_resolution": { "type": "version", "tag": "v1.0.3", "commit": "dda1df6aaf452aedf3e52ff0cf69e72439452216" }, - "_source": "git://github.com/polymerelements/iron-resizable-behavior.git", + "_source": "git://github.com/PolymerElements/iron-resizable-behavior.git", "_target": "^1.0.0", - "_originalSource": "polymerelements/iron-resizable-behavior" + "_originalSource": "PolymerElements/iron-resizable-behavior" } \ No newline at end of file diff --git a/dashboard-ui/components/viewcontainer-lite.js b/dashboard-ui/components/viewcontainer-lite.js index c4b5fbd38b..8b8bbcd1ce 100644 --- a/dashboard-ui/components/viewcontainer-lite.js +++ b/dashboard-ui/components/viewcontainer-lite.js @@ -76,7 +76,7 @@ define(['browser'], function (browser) { } if (currentPage) { - if (newViewInfo.hasScript) { + if (newViewInfo.hasScript && window.$) { // TODO: figure this out without jQuery view = $(view).appendTo(mainAnimatedPages)[0]; mainAnimatedPages.removeChild(currentPage); @@ -84,7 +84,7 @@ define(['browser'], function (browser) { mainAnimatedPages.replaceChild(view, currentPage); } } else { - if (newViewInfo.hasScript) { + if (newViewInfo.hasScript && window.$) { // TODO: figure this out without jQuery view = $(view).appendTo(mainAnimatedPages)[0]; } else { diff --git a/dashboard-ui/legacy/buttonenabled.js b/dashboard-ui/legacy/buttonenabled.js index 19a32f85a6..ce0d84ed7c 100644 --- a/dashboard-ui/legacy/buttonenabled.js +++ b/dashboard-ui/legacy/buttonenabled.js @@ -1,4 +1,7 @@ -$.fn.buttonEnabled = function (enabled) { +define(['jQuery'], function ($) { - return enabled ? this.attr('disabled', '').removeAttr('disabled') : this.attr('disabled', 'disabled'); -}; \ No newline at end of file + $.fn.buttonEnabled = function (enabled) { + + return enabled ? this.attr('disabled', '').removeAttr('disabled') : this.attr('disabled', 'disabled'); + }; +}); \ No newline at end of file diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js index f331f6b8b6..f7b5ab4dad 100644 --- a/dashboard-ui/scripts/dashboardpage.js +++ b/dashboard-ui/scripts/dashboardpage.js @@ -1,4 +1,4 @@ -define(['datetime'], function (datetime) { +define(['datetime', 'jQuery'], function (datetime, $) { function renderNoHealthAlertsMessage(page) { diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 789cd3c3a8..f4ecc57afe 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -1,4 +1,4 @@ -define(['imageLoader', 'layoutManager', 'jQuery'], function (imageLoader, layoutManager, $) { +define(['imageLoader', 'layoutManager', 'viewManager'], function (imageLoader, layoutManager, viewManager) { var mainDrawerPanel = document.querySelector('.mainDrawerPanel'); @@ -420,7 +420,7 @@ var pageIds = link.getAttribute('data-pageids'); if (pageIds) { - selected = pageIds.split(',').indexOf($.mobile.activePage.id) != -1 + selected = pageIds.split(',').indexOf(viewManager.currentView().id) != -1 } if (selected) { @@ -737,14 +737,12 @@ var html = title; - if (window.$ && $.mobile) { - var page = $.mobile.activePage; - if (page) { - var helpUrl = page.getAttribute('data-helpurl'); + var page = viewManager.currentView(); + if (page) { + var helpUrl = page.getAttribute('data-helpurl'); - if (helpUrl) { - html += '' + Globalize.translate('ButtonHelp') + ''; - } + if (helpUrl) { + html += '' + Globalize.translate('ButtonHelp') + ''; } } @@ -1078,9 +1076,7 @@ var admin = false; if (!page) { - if (window.$ && window.$.mobile) { - page = $.mobile.activePage; - } + page = viewManager.currentView(); } if (page && page.classList.contains('type-interior')) {