diff --git a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js index 5fa6ce96e9..41d52560e6 100644 --- a/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js +++ b/dashboard-ui/bower_components/emby-webcomponents/itemhelper.js @@ -117,6 +117,15 @@ define(['apphost'], function (appHost) { canEditImages: function (user, itemType) { + if (itemType == 'UserView') { + if (user.Policy.IsAdministrator) { + + return true; + } + + return false; + } + return itemType != 'Timer' && canEdit(user, itemType); }, diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js deleted file mode 100644 index 4490e9246c..0000000000 --- a/dashboard-ui/scripts/librarylist.js +++ /dev/null @@ -1,59 +0,0 @@ -define(['libraryBrowser'], function (libraryBrowser) { - - function isClickable(target) { - - while (target != null) { - var tagName = target.tagName || ''; - if (tagName == 'A' || tagName.indexOf('BUTTON') != -1 || tagName.indexOf('INPUT') != -1) { - return true; - } - - return false; - //target = target.parentNode; - } - - return false; - } - - function onGroupedCardClick(e, card) { - - var itemId = card.getAttribute('data-id'); - var context = card.getAttribute('data-context'); - - var userId = Dashboard.getCurrentUserId(); - - var playedIndicator = card.querySelector('.playedIndicator'); - var playedIndicatorHtml = playedIndicator ? playedIndicator.innerHTML : null; - var options = { - - Limit: parseInt(playedIndicatorHtml || '10'), - Fields: "PrimaryImageAspectRatio,DateCreated", - ParentId: itemId, - GroupItems: false - }; - - var target = e.target; - if (isClickable(target)) { - return; - } - - ApiClient.getJSON(ApiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) { - - if (items.length == 1) { - Dashboard.navigate(libraryBrowser.getHref(items[0], context)); - return; - } - - var url = 'itemdetails.html?id=' + itemId; - if (context) { - url += '&context=' + context; - } - - Dashboard.navigate(url); - }); - - e.stopPropagation(); - e.preventDefault(); - return false; - } -}); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 1baa1b53af..380f610980 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1727,6 +1727,12 @@ var AppInfo = {}; return bowerPath; } + function getLayoutManager(layoutManager) { + + layoutManager.init(); + return layoutManager; + } + function initRequire() { var urlArgs = "v=" + (window.dashboardVersion || new Date().getDate()); @@ -1763,7 +1769,6 @@ var AppInfo = {}; qualityoptions: embyWebComponentsBowerPath + "/qualityoptions", connectservice: apiClientBowerPath + '/connectservice', hammer: bowerPath + "/hammerjs/hammer.min", - layoutManager: embyWebComponentsBowerPath + "/layoutmanager", pageJs: embyWebComponentsBowerPath + '/page.js/page', focusManager: embyWebComponentsBowerPath + "/focusmanager", datetime: embyWebComponentsBowerPath + "/datetime", @@ -1823,6 +1828,7 @@ var AppInfo = {}; define("mediaInfo", [embyWebComponentsBowerPath + "/mediainfo/mediainfo"], returnFirstDependency); define("itemContextMenu", [embyWebComponentsBowerPath + "/itemcontextmenu"], returnFirstDependency); define("dom", [embyWebComponentsBowerPath + "/dom"], returnFirstDependency); + define("layoutManager", [embyWebComponentsBowerPath + "/layoutmanager"], getLayoutManager); define("playMenu", [embyWebComponentsBowerPath + "/playmenu"], returnFirstDependency); define("refreshDialog", [embyWebComponentsBowerPath + "/refreshdialog/refreshdialog"], returnFirstDependency); define("backdrop", [embyWebComponentsBowerPath + "/backdrop/backdrop"], returnFirstDependency); @@ -3153,7 +3159,6 @@ var AppInfo = {}; deps.push('imageLoader'); deps.push('embyRouter'); - deps.push('layoutManager'); if (!(AppInfo.isNativeApp && browserInfo.android)) { document.documentElement.classList.add('minimumSizeTabs'); @@ -3187,14 +3192,12 @@ var AppInfo = {}; console.log('onAppReady - loading dependencies'); - require(deps, function (imageLoader, pageObjects, layoutManager) { + require(deps, function (imageLoader, pageObjects) { console.log('Loaded dependencies in onAppReady'); window.ImageLoader = imageLoader; - layoutManager.init(); - window.Emby = {}; window.Emby.Page = pageObjects; window.Emby.TransparencyLevel = pageObjects.TransparencyLevel;