feat(requests): show or hide request desc help tooltip info

This commit is contained in:
OldHawk
2018-01-15 14:40:02 +08:00
parent f04bf5ff8f
commit b35cca2fbf
13 changed files with 271 additions and 21 deletions

View File

@@ -9,7 +9,7 @@
'NotifycationService', '$stateParams', 'marked', 'ModalConfirmService', '$compile', 'DownloadService', 'TorrentGetInfoServices', 'ResourcesTagsServices'];
function RequestsViewController($scope, $rootScope, $state, $timeout, $translate, Authentication, RequestsService, localStorageService, MeanTorrentConfig, mtDebug,
NotifycationService, $stateParams, marked, ModalConfirmService, $compile, DownloadService, TorrentGetInfoServices, ResourcesTagsServices) {
NotifycationService, $stateParams, marked, ModalConfirmService, $compile, DownloadService, TorrentGetInfoServices, ResourcesTagsServices,) {
var vm = this;
vm.user = Authentication.user;
vm.itemsPerPageConfig = MeanTorrentConfig.meanTorrentConfig.itemsPerPage;
@@ -18,6 +18,7 @@
vm.DLS = DownloadService;
vm.TGI = TorrentGetInfoServices;
vm.RTS = ResourcesTagsServices;
vm.show_desc_help = localStorageService.get('requests_view_show_help') || 'yes';
vm.searchTags = [];
@@ -266,5 +267,35 @@
return exp;
};
/**
* onShowHelpClicked
*/
vm.onShowHelpClicked = function () {
var e = $('.requests-desc');
if (e.hasClass('panel-collapsed')) {
e.slideDown();
e.removeClass('panel-collapsed');
localStorageService.set('requests_view_show_help', 'yes');
} else {
e.slideUp();
e.addClass('panel-collapsed');
localStorageService.set('requests_view_show_help', 'no');
}
};
/**
* onCloseHelpClicked
*/
vm.onCloseHelpClicked = function () {
var e = $('.requests-desc');
if (!e.hasClass('panel-collapsed')) {
e.slideUp();
e.addClass('panel-collapsed');
localStorageService.set('requests_view_show_help', 'no');
}
};
}
}());