Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/survey_client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-12-17 16:28:57 +0300
committerJoas Schilling <nickvergessen@owncloud.com>2015-12-17 16:28:57 +0300
commit3c9e289304f7e867d765a6756de191d90746fbea (patch)
tree5df44932d97b41051f61624bd4dd0edc76dc6be9 /js
parentc630a029fd7c9d71f9a13cd6f6f38b1b4698eedd (diff)
Handle background job generation
Diffstat (limited to 'js')
-rw-r--r--js/admin.js29
1 files changed, 23 insertions, 6 deletions
diff --git a/js/admin.js b/js/admin.js
index bb0fad7..1bad24b 100644
--- a/js/admin.js
+++ b/js/admin.js
@@ -1,12 +1,29 @@
$(document).ready(function() {
var $section = $('#popularitycontestclient');
$section.find('.popularitycontestclient_category').change(function() {
- console.log('setValue');
- OC.AppConfig.setValue(
- 'popularitycontestclient',
- $(this).attr('name').substring(24),
- $(this).attr('checked') ? 'yes' : 'no'
- );
+ var $button = $(this);
+ $button.attr('disabled', true);
+
+ OC.AppConfig.postCall('setValue', {
+ app: 'popularitycontestclient',
+ key: $(this).attr('name').substring(24),
+ value: $(this).attr('checked') ? 'yes' : 'no'
+ }, function() {
+ $button.attr('disabled', false);
+ });
+ });
+
+ $section.find('#popularitycontestclient_monthly_report').change(function() {
+ var $button = $(this);
+ $button.attr('disabled', true);
+
+ $.ajax({
+ url: OC.linkToOCS('apps/popularitycontestclient/api/v1/', 2) + 'monthly?format=json',
+ type: $(this).attr('checked') ? 'POST' : 'DELETE',
+ success: function() {
+ $button.attr('disabled', false);
+ }
+ });
});
$section.find('button').click(function() {