mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
jQuery reduction
This commit is contained in:
parent
438755e048
commit
54333d6d2f
2 changed files with 20 additions and 13 deletions
|
@ -196,7 +196,7 @@
|
||||||
|
|
||||||
function onMoreButtonClick() {
|
function onMoreButtonClick() {
|
||||||
|
|
||||||
var card = $(this).parents('.card')[0];
|
var card = parentWithClass(this, 'card');
|
||||||
|
|
||||||
showContextMenu(card, {
|
showContextMenu(card, {
|
||||||
showPlayOptions: false
|
showPlayOptions: false
|
||||||
|
@ -522,7 +522,7 @@
|
||||||
MediaController.play(itemId);
|
MediaController.play(itemId);
|
||||||
break;
|
break;
|
||||||
case 'playallfromhere':
|
case 'playallfromhere':
|
||||||
playAllFromHere(index, $(card).parents('.itemsContainer'), 'play');
|
playAllFromHere(index, parentWithClass(card, 'itemsContainer'), 'play');
|
||||||
break;
|
break;
|
||||||
case 'queue':
|
case 'queue':
|
||||||
MediaController.queue(itemId);
|
MediaController.queue(itemId);
|
||||||
|
@ -539,7 +539,7 @@
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case 'queueallfromhere':
|
case 'queueallfromhere':
|
||||||
playAllFromHere(index, $(card).parents('.itemsContainer'), 'queue');
|
playAllFromHere(index, parentWithClass(card, 'itemsContainer'), 'queue');
|
||||||
break;
|
break;
|
||||||
case 'sync':
|
case 'sync':
|
||||||
require(['syncDialog'], function (syncDialog) {
|
require(['syncDialog'], function (syncDialog) {
|
||||||
|
@ -884,7 +884,7 @@
|
||||||
|
|
||||||
function showTapHoldHelp(element) {
|
function showTapHoldHelp(element) {
|
||||||
|
|
||||||
var page = $(element).parents('.page')[0];
|
var page = parentWithClass(element, 'page');
|
||||||
|
|
||||||
if (!page) {
|
if (!page) {
|
||||||
return;
|
return;
|
||||||
|
@ -1187,7 +1187,7 @@
|
||||||
hideSelections();
|
hideSelections();
|
||||||
break;
|
break;
|
||||||
case 'groupvideos':
|
case 'groupvideos':
|
||||||
combineVersions($($.mobile.activePage)[0], items);
|
combineVersions($.mobile.activePage, items);
|
||||||
break;
|
break;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
items.map(function (itemId) {
|
items.map(function (itemId) {
|
||||||
|
@ -1291,7 +1291,7 @@
|
||||||
|
|
||||||
index = elemWithAttributes.getAttribute('data-index');
|
index = elemWithAttributes.getAttribute('data-index');
|
||||||
|
|
||||||
itemsContainer = $(elem).parents('.itemsContainer');
|
itemsContainer = parentWithClass(elem, 'itemsContainer');
|
||||||
|
|
||||||
playAllFromHere(index, itemsContainer, 'play');
|
playAllFromHere(index, itemsContainer, 'play');
|
||||||
}
|
}
|
||||||
|
@ -1377,7 +1377,7 @@
|
||||||
|
|
||||||
var itemsContainers = page.querySelectorAll('.itemsContainer:not(.noautoinit)');
|
var itemsContainers = page.querySelectorAll('.itemsContainer:not(.noautoinit)');
|
||||||
for (var i = 0, length = itemsContainers.length; i < length; i++) {
|
for (var i = 0, length = itemsContainers.length; i < length; i++) {
|
||||||
$(itemsContainers[i]).createCardMenus();
|
LibraryBrowser.createCardMenus(itemsContainers[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$('.categorySyncButton', page).on('click', function () {
|
$('.categorySyncButton', page).on('click', function () {
|
||||||
|
@ -1458,7 +1458,7 @@
|
||||||
if (mediaType == 'Video') {
|
if (mediaType == 'Video') {
|
||||||
this.setAttribute('data-positionticks', (userData.PlaybackPositionTicks || 0));
|
this.setAttribute('data-positionticks', (userData.PlaybackPositionTicks || 0));
|
||||||
|
|
||||||
if ($(this).hasClass('card')) {
|
if (this.classList.contains('card')) {
|
||||||
renderUserDataChanges(this, userData);
|
renderUserDataChanges(this, userData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
(function ($, document, Dashboard) {
|
define([], function () {
|
||||||
|
|
||||||
function notifications() {
|
function notifications() {
|
||||||
|
|
||||||
|
@ -39,10 +39,17 @@
|
||||||
|
|
||||||
promise.then(function (summary) {
|
promise.then(function (summary) {
|
||||||
|
|
||||||
var item = $('.btnNotificationsInner').removeClass('levelNormal').removeClass('levelWarning').removeClass('levelError').html(summary.UnreadCount);
|
var btnNotificationsInner = document.querySelector('.btnNotificationsInner');
|
||||||
|
if (btnNotificationsInner) {
|
||||||
|
|
||||||
if (summary.UnreadCount) {
|
btnNotificationsInner.classList.remove('levelNormal');
|
||||||
item.addClass('level' + summary.MaxUnreadNotificationLevel);
|
btnNotificationsInner.classList.remove('levelWarning');
|
||||||
|
btnNotificationsInner.classList.remove('levelError');
|
||||||
|
btnNotificationsInner.innerHTML = summary.UnreadCount;
|
||||||
|
|
||||||
|
if (summary.UnreadCount) {
|
||||||
|
btnNotificationsInner.classList.add('level' + summary.MaxUnreadNotificationLevel);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -205,4 +212,4 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
})(jQuery, document, Dashboard);
|
});
|
Loading…
Add table
Add a link
Reference in a new issue