1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

enable unified routing

This commit is contained in:
Luke Pulverenti 2016-03-16 01:33:31 -04:00
parent 2360213901
commit 154f6b5fd8
133 changed files with 6988 additions and 7112 deletions

View file

@ -1,4 +1,100 @@
define(['jqm'], function () {
define(['jQuery'], function () {
jQuery.mobile = {};
(function ($, window, undefined) {
function parentWithClass(elem, className) {
while (!elem.classList || !elem.classList.contains(className)) {
elem = elem.parentNode;
if (!elem) {
return null;
}
}
return elem;
}
$.extend($.mobile, {
// Place to store various widget extensions
behaviors: {}
});
// plugins
$.fn.extend({
// Enhance child elements
enhanceWithin: function () {
var index,
widgetElements = {},
that = this;
// Enhance widgets
$.each($.mobile.widgets, function (name, constructor) {
// If initSelector not false find elements
if (constructor.initSelector) {
// Filter elements that should not be enhanced based on parents
var elements = that[0].querySelectorAll(constructor.initSelector);
// Enhance whatever is left
if (elements.length > 0) {
widgetElements[constructor.prototype.widgetName] = $(elements);
}
}
});
for (index in widgetElements) {
widgetElements[index][index]();
}
return this;
}
});
})(jQuery, this);
jQuery.mobile.widgets = {};
// plugins
$.fn.extend({
// Enhance child elements
enhanceWithin: function () {
var index,
widgetElements = {},
that = this;
// Enhance widgets
$.each($.mobile.widgets, function (name, constructor) {
// If initSelector not false find elements
if (constructor.initSelector) {
// Filter elements that should not be enhanced based on parents
var elements = that[0].querySelectorAll(constructor.initSelector);
// Enhance whatever is left
if (elements.length > 0) {
widgetElements[constructor.prototype.widgetName] = $(elements);
}
}
});
for (index in widgetElements) {
widgetElements[index][index]();
}
return this;
}
});
// For backcompat remove in 1.5
jQuery(document).on("create", function (event) {
jQuery(event.target).enhanceWithin();
});
/*!
* jQuery UI Widget c0ab71056b936627e8a7821f03c044aec6280a40