You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/PlexRequests.UI/Content/app/requests/requestsController.js

51 lines
1.3 KiB

(function () {
var controller = function($scope, requestsService) {
$scope.requests = [];
$scope.selectedTab = {};
$scope.currentPage = 1;
$scope.tabs = [];
$scope.plexSettings = {};
$scope.requestSettings = {};
// Search
$scope.searchTerm = "";
// Called on page load
$scope.init = function() {
// Get the settings
$scope.plexSettings = requestsService.getPlexRequestSettings(getBaseUrl());
$scope.requestSettings = requestsService.getRequestSettings(getBaseUrl());
if ($scope.plexSettings.SearchForMovies) {
$scope.selectedTab = "movies";
// Load the movie Requests
$scope.requests = requestsService.getRequests("movie", getBaseUrl());
}
};
$scope.changeTab = function(tab) {
// load the data from the tab
switch (tab) {
// Set the selected tab and load the appropriate data
}
};
$scope.search = function() {
$scope.requests = requestsService.getRequests
};
function getBaseUrl() {
return $('#baseUrl').val();
}
}
angular.module('PlexRequests').controller('requestsController', ["$scope", "requestsService", controller]);
}());